Hosting / Forms
Using Forms
Create forms for your sites. CloudCannon sends named form data to email addresses of your choosing. Alternatively, use a hook to integrate with services like Zapier or IFTTT.
To create a 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
<form method="post" action="/success.html">
<label>Email Address</label>
<input type="text" name="email">
<label>Name</label>
<input type="text" name="name">
<label>Message</label>
<textarea name="message"></textarea>
<label>Urgent</label>
<input type="checkbox" name="urgent">
<label>Type of Enquiry</label>
<input type="radio" name="_subject" value="Sales Enquiry"> Sales
<input type="radio" name="_subject" value="General Enquiry"> General
<input type="hidden" name="_to" value="sales@example.com,support@example.com">
<input type="hidden" name="_cc" value="sales.tracker@example.com">
<input type="text" name="_gotcha" style="display: none;">
<input type="submit" value="Send Message">
</form>
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.
If a _hook
is defined, this field will not be used.
<input type="hidden" name="_to" value="contact@example.com">
_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.
<label>
Your Email Address
<input type="text" name="_replyto">
</label>
_subject
The subject of the email.
<select name="_subject">
<option>General Enquiry</option>
<option>Quote Request</option>
<option>Support</option>
</select>
_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.
<input type="hidden" name="_cc" value="contact@example.com">
_hook
Instead of sending an email, a webhook can be supplied for the data to be sent to.
<input type="hidden" name="_hook" value="https://hooks.zapier.com/hooks/catch/1234567/abcdef/">
See Webhooks.
_gotcha
Honeypot field for preventing untargeted spam. CloudCannon does not send the email if this field has a value. Hide it with CSS to prevent visitors filling it out.
<input type="text" name="_gotcha" style="display: none;">
For better spam prevention try using Google reCAPTCHA.