Create contact forms for your sites. CloudCannon sends named form data to email addresses of your choosing.
To create a contact form:
Add an HTML form to a file
Set the method attribute to post
Set the action to where the visitor is redirected after the form submission
Add form fields with name attributes to collect data from visitors
Special Fields
Use these fields to customise the email CloudCannon sends through the form. The fields can be hidden or visible depending on your requirements.
_to
The address (or addresses) that CloudCannon sends the email to.
Send the email to multiple addresses by separating them with commas.
_replyto or email
The value used for the Reply-To header in the email.
Use this to ensure clients reply to the visitor rather than a default CloudCannon address.
_subject
The subject of the email.
_gotcha
Honeypot field for preventing spam.
CloudCannon does not send the email if this field has a value.
Hide it with CSS to prevent visitors filling it out.
_cc
The value used for the CC header in the email.
Use this to send a copy in another address (or addresses) without sending it directly.
Send a copy of the email to multiple addresses by separating them with commas.
Submitting with AJAX
Submitting a form with JavaScript saves a page load after sending a message, providing a more seamless experience.
Viewers without JavaScript enabled fall back to the normal flow.
To submit your contact form with JavaScript:
Build and test your contact form
Override the submit event on your form
Change the page to notify your viewers the message was sent
Start with this JavaScript snippet and adapt it for your site: