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:
  1. Log in to your Basin account
  2. Select your form
  3. Navigate to the Emails page
  4. Scroll down to the 'Custom Template' section and click the radio button for "Use your own HTML template"
  5. Type in, or paste in your HTML template in the box
  6. Click "Save" at the bottom of the page
Custom templates do not support special characters or spaces in form field names. This includes hyphens, dashes, and quotation marks. If you have form fields that contain a hyphen, we recommend renaming them to use underscore instead.
Simple HTML example

You can use merge tags to fill in data from a submitted form. So if you had a form like this

HTML
<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

 

email

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
<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

HTML
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}}

HTML
{{#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