Email Form Submissions To The Submitter

In this tutorial, we’ll walk through how to automatically email a copy of a form submission to the person who submitted it, using Oncord’s Marketing Automation tools. This is commonly used for contact forms, event registrations, and enquiries where users expect a confirmation or record of their submission.

By the end of this guide, you’ll have a working automation that sends a confirmation email to the submitter as soon as a form is successfully submitted.

Prerequisites

Before starting this tutorial, make sure the Marketing feature is enabled on your project. Marketing Automation is required to create and send automated emails based on form submissions.

Create the form

Start by creating a form that collects the required user details. You can use an existing form or create a new one using the example below.

Add the following markup to your page:

<forms:form id="form_cc" recordsubmissions="true" contactmode="store" onsubmitemailsubject="Website Enquiry" onsubmitemail="true" method="ajax"> <templates:row> <templates:column width="6"> <forms:row label="First Name" type="one_column"> <forms:editbox id="contact_first_name" validations="mandatory" /> </forms:row> </templates:column> <templates:column width="6"> <forms:row label="Last Name" type="one_column"> <forms:editbox id="contact_last_name" validations="mandatory" /> </forms:row> </templates:column> </templates:row> <templates:row> <templates:column width="6"> <forms:row label="Email Address" type="one_column"> <forms:editbox id="contact_email" validations="mandatory,email" transformations="tolower" /> </forms:row> </templates:column> <templates:column width="6"> <forms:row type="two_column" label="Preferrred Communication"> <forms:radiobuttongroup name="preferred_communication" validations="mandatory"> <forms:radiobutton valuechecked="Email" label="Email" /> <forms:radiobutton valuechecked="Phone" label="Phone" /> <forms:radiobutton valuechecked="Social Media" label="Social Media" /> </forms:radiobuttongroup> </forms:row> </templates:column> </templates:row> <templates:row> <templates:column width="6"> <forms:row type="one_column" label="Phone Number"> <forms:editbox id="contact_phone" width="100%" /> </forms:row> </templates:column> <templates:column width="6"> <forms:row type="one_column" label="Social Media URL"> <forms:editbox width="100%" id="contact_social" /> </forms:row> </templates:column> </templates:row> <forms:row label="Message" type="one_column"> <forms:textarea id="message" height="130" validations="mandatory" /> </forms:row> <forms:row type="one_column"> <forms:submitbutton>Send</forms:submitbutton> </forms:row> <forms:successcontent> <h3 style="text-align: center;">Thank you! We've received your submission.</h3> <p style="text-align: center;">One of our staff will get back to you shortly.</p> </forms:successcontent> </forms:form>
Important

Take note of the following, as they’ll be used later:

  • Form ID: form_cc
  • Field IDs:
    • contact_first_name
    • contact_last_name
    • contact_email
    • preferred_communication
    • contact_phone
    • contact_social
    • message

Submit the form and get the generated form ID

Before the form can be used in Marketing Automation, it must have at least one submission.

  1. Fill in the form with test data
  2. Submit the form
  3. Confirm the success message appears

Next, retrieve the generated form ID value:

  1. Go to Pages > Forms
  2. Locate your form. In this example, it’s form_cc
  3. Click the form name
  4. Check the browser URL. The URL will contain the form_id value.
    /admin/website/pages/forms/submissions/?form_id=32

Make a note of this form ID. You’ll need it when setting up the automation.

Create a new automation

Once the form is confirmed to be working, go to Marketing > Automation.

  1. Click New Automation
  2. Enter an Automation Title
  3. In the Upon Event dropdown, select Forms – When a form is submitted

A list of available form IDs will appear. Locate and select your form.

In this example, choose form_cc.

You’ll also see an option to configure And Submission Meets Conditions. This can be used to limit when the automation runs, but for this tutorial, we’ll skip this step.

Add the email action to the workflow

Scroll down to the Workflow section.

  1. From the dropdown, select Send E-mail to Customer
  2. Click Create New Message

This creates a new email message for the automation. Click Edit Message next to it to customise the email content.

The email editor will open in a new tab. Your automation setup is saved, so you can safely return to it later.

Create the email message for the submitter

In the email editor:

  1. Enter a Subject at the top
  2. Select your preferred Design

To insert the submitted form data:

  1. Click Source on the left panel
  2. Paste the following code into the editor:
<logic:variable as="submission" value="[? \Components\Website\Pages\Forms::getLastSubmission(32) ?]" /> <p> Name: [? $submission['contact_first_name'] ?] [? $submission['contact_last_name'] ?]<br /> Preferred Communication: [? $submission['preferred_communication'] ?]<br /> Email: [? $submission['contact_email'] ?]<br /> Phone: [? $submission['contact_phone'] ?]<br /> Social Media URL: [? $submission['contact_social'] ?]<br /> Message: [? $submission['message'] ?] </p>
Notes
  • Replace 32 with your actual form ID
  • The $submission[...] values must match the field IDs from your form

Save the email message once complete.

Enable and test the automation

Return to the Automation tab.

  1. Click Live Mode
  2. Tick Enable this Automation
  3. Click Save Automation

Submit the form again with test data and confirm that:

  • The form submits successfully
  • A copy of the submission is emailed to the submitter

Make any adjustments if needed. Once confirmed, your automation is ready and fully active.