Skip to main content
All CollectionsForms and data basesEmail notifications
How to use form fields in custom email templates
How to use form fields in custom email templates

Use form field data and variables to customize email templates sent after form submissions. Include names, answers, and more.

Updated over a week ago

Using form field variables in custom email templates allows you to send personalized emails based on the responses submitted in your form.

This can be helpful to automatically include the submitter’s name, their answers to questions, and other relevant data.

For example, you can include the submitter’s name in the subject line to make the email more engaging.

This guide will help you personalize your emails by utilizing form field data.

Setting up custom emails in your forms

To set up custom email templates, you can pipe the submitted data into the email content, subject, and sender fields.

📝 Additional insights:

Learn how to set up custom emails on your forms and surveys easily by following our guide on How to send custom email templates. This will help you streamline your email setup process and enhance user engagement through personalized communication.

Here's how you can include form responses in various sections of your custom emails:

These variables can be basic text (e.g., form title), URLs (e.g., form logo or address), or dynamically generated data (e.g., results table).

Available variables for custom emails

Form variables

These variables pertain to the form itself and include elements like the form title, description, and success message. They can be used to reference the form's metadata.

  1. {{form_title}}: Title of the form.

  2. {{form_description}}: Form’s description. Note that this field may have its own styling since it’s created using WYSIWYG.

  3. {{form_success_message}}: Form’s success message, since you may want to include it in the email as well.

  4. {{form_currency}}: Forms currency code (ISO). For example, USD or EUR.

  5. {{form_full_address}}: A URL to the form’s display page (as seen by the end-user). If you’re using subdomains or custom domains, it will be linked to your custom URL. But if you’ve embedded the form in a custom page, it won’t be linked to that page.

  6. {{form_logo}}: A URL to the form’s logo if you want to show it in the email.

💡 Pro Tip:

These form variables are particularly useful when creating templates that apply to multiple forms. You can reference them to make your emails more adaptable.

Submitted data variables

These are the most important variables that contain the fields, the submitted data on them, the result of the calculations, and a link to the row’s edit page (accessible by the form admin).

Fields

  • {{field_i_title}}: Title of a field based on its position on the form. For example, {{field_2_title}} will be replaced by the title of the 2nd field in the form, and the 4th field’s title will replace {{field_4_title}}.

📝 Additional Insights:

To find the field numbers for use in custom email templates, simply click on the field in your form editor.

The field number is displayed next to the field name, marked with a #number.

custom emails template

For example, in the provided screenshot, the Email field is labeled as #4, indicating that it is the fourth field in the form.

You can use this number to reference the field’s title, value, or URL in your email templates using variables like {{field_4_title}}, {{field_4_value}}, or {{field_4_url}} (for file fields).

This makes it easy to pull in form responses and personalize emails effectively dynamically.

  • {{field_i_value}}: Value of a field based on its position on the form. For example, {{field_2_value}}. will be replaced by the title of the 2nd field in the form, and the 4th field’s title will replace {{field_4_value}}. This value can be a simple text for most of the fields, such as a choice field, text field, etc, or a link tag for file fields.

  • {{field_i_url}}: If a field is a file field, you can use this variable. For example, if your file field is in the 3rd position of your form, you should use {{field_3_url}}. While {{field_3_url}} is an HTML tag containing the file’s URL. For any field except File fields, this value will be empty.

  • {{alias_title}}, {{alias_value}}, and {{alias_url}}: You can use these to access the fields’ data based on their alias. For example, if a short text field’s alias is first_name, I can access its title and submitted value using {{first_name_title}} and {{first_name_value}}.

💡 Pro Tip:
These variables make it easy to pull in the data entered by respondents, making each email fully personalized. You can also access data based on field aliases, which is particularly helpful for custom field names.

Calculation variables

These variables are useful for forms with calculations, such as score-based assessments or pricing estimations.

  • {{score_value}}: The calculated score for the forms with Logic & calculations.

  • {{currency}}: The calculated currency for the forms with Logic & calculations.

Order data

For forms that involve payments, you can use the following variables to include order details.

  • {{order_status}}: The order status for the forms with payment.

  • {{order_code}}: The order code for the forms with payment.

  • {{payment_amount}}: The payment amount for the forms with payment.

Basic data

These variables track important form submission metadata.

  • {{created_at}}: When was the submission created.

  • {{submitter_referer_address}}: From which address has the user submitted the form?

  • {{email_verification_state}}: Email field verification status if the form has an email verification field.

  • {{tracking_code}}: Row’s tracking code if the form is to give a tracking code to the user.

  • {{submit_time}}: How long (minutes) did it take for the user to submit the form.

  • {{response_admin_address}}: A URL to the response’s admin page (only accessible by the user with sufficient access).

Advanced

  • {{user_email}}: Submitter’s email address if the form is receiving the user’s email on an email field.

  • {{results_table}}: Will be replaced by a pre-rendered table containing all of the fields and their submitted data.

  • {{pdf_link}}: You can attach PDFs of submissions to the email notifications by adding the variable ID of pdf_link to your email template

How to use variables for the email Subject, sender name, and sender email

While you can use form variables in various parts of your custom email template, there are some limitations for the email subject, sender name, and sender email fields.

  • Email Subject: Only simple variables (e.g., form title or user name) can be used in the subject line. Complex variables like {{results_table}} aren’t supported.

  • Sender Name: This field can accept variables that return text (e.g., user’s name) but should be mindful of length limitations.

  • Sender Email: For email delivery to succeed, ensure that the sender's email is either a predefined email address or a variable {{user_email}} that returns a valid email address.

💡 Pro Tip:

For email delivery to function correctly, always check that the email variables are properly set and that no complex variables are used in fields like the subject, sender name, or sender email.

Example:

To illustrate how to utilize form field variables in custom email templates, consider the following example.

Suppose you've created a self-grading quiz form where the first field captures the student's name (with the alias first_name), and another field calculates the total score (with the alias total_score).

By incorporating these variables into your email template, you can send personalized feedback to each student upon submission.

Step 1- Setting up the self-grading quiz form:

  • Field 1: Student name

    • Type: Short text

    • ID (Alias): first_name

    • This field will capture the student's name.

  • Field 2: Quiz questions

    • Add your quiz questions here, each with appropriate field types (e.g., multiple choice, true/false).

    • Assign point values to each question as needed.

  • Field 3: Total score

    • Type: Variable field

    • ID (Alias): total_score

    • Set up this field to capture the total score based on the student's answers.

Step 2- Creating the custom email template:

To personalize the email sent to students after they submit the quiz, use the following template:

Email Subject: {{form_title}} - Response from {{first_name_value}}

This subject line includes the title of the form and the student's name, making it easy to identify each submission.

Email Body:

Hello, {{first_name_value}}! Here's a summary of your submission for {{form_title}}.

Your total score is: {{total_score_value}}

{{results_table}}

Click to receive a PDF of your responses:
{{pdf_link}}

Best regards,
[Your Name/Organization]

Explanation:

  • {{first_name_value}}: Inserts the student's name.

  • {{form_title}}: Inserts the title of the form.

  • {{total_score_value}}: Displays the student's total score.

  • {{results_table}}: Generates a table with all questions and the student's answers.

  • {{pdf_link}}: Provides a link to download a PDF copy of the submission.

Enable PDF attachment (Optional):

  • If you want to attach a PDF of the submission, ensure the {{pdf_link}} variable is included in the email body.

  • Enable the option to attach PDFs directly in the email settings.

By following these steps, each student will receive a personalized email with their quiz results, enhancing their experience and providing immediate feedback.

Note: Ensure that all field IDs (aliases) match exactly with those used in your form to avoid any discrepancies in the email content.

Did this answer your question?