Custom Templates & Merge Tags
Use your own HTML templates for submission emails instead of our default. Merge tags allow you to build your own templates or merge submission data into our email customization fields.
To use custom templates, follow these steps:
- Log in to your Basin account
- Select your form
- Navigate to the Emails page
- Scroll down to the 'Custom Template' section and click the radio button for "Use your own HTML template"
- Type in, or paste in your HTML template in the box
- Click "Save" at the bottom of the page
Simple HTML example
You can use merge tags to fill in data from a submitted form. So if you had a form like this
<form action="https://usebasin.com/f/1a2b3c4d5e6f" method="POST"> <label for="name">Name</label> <input type="text" id="name" name="name" required> <label for="email-address">Email Address</label> <input type="email" id="email" name="email" required> <button type="submit">Submit</button> </form>
Your form submissions would look something like this
name
Elon Musk
ElonMusk@Tesla.com
You could then access the name and email merge tags by typing in the name of the field inside curly brackets
<html> ... <b>Name: </b> {{name}}<br> <b>Phone number: </b> {{phone_number}}<br> ... </html>
You can use these merge tags in your response emails
Custom subject
Custom response
Using #each
You can use {{#each form_params}} to get all the values from the form. Use {{this.name}} for the name of the field, and {{this.value}} for the values submitted
Here is all the data submitted: <br> {{#each form_params}} <h2>{{this.name}}</h2> <div>{{this.value}}</div> {{/each}}
Attachments:
For attachments, loop through attached files with {{#each attachment}}, then use {{this.name}}, {{this.public_url}}, and {{this.file_size}}
{{#each attachment}} <a href="{{this.public_url}}">{{this.name}}</a> <!-- OR --> <img src="{{this.public_url}}"/> <b>File size:</b>{{this.file_size}} bytes {{/each}}
Timestamps
You can include a timestamp of when a form was submitted by using the {{timestamp}} tag.
The timezone can be selected under the My Account tab in Account Settings.
Please note:
We can't possibly catch all the errors that you may have in your template. If the template throws an error, you will receive the submission email with our default template and a note that your template didn't work. If you need help with your template, feel free to contact us.
Our default template can be found here