Forms Autoresponder
Hooks allows us to create custom email notifications that are sent to the customer upon form submission. In this example we will create a hook that will send a email to the customer that includes a PDF guide for them to download.
Navigate to Automations > Hooks > List and add a new hook to the existing list:
Add Name & Description to the new hook, this will also display on the Hooks list page
Configure the “Entity Event Triggers”:
Entity: Form Submission
Method: Completed
Save the Hook
Upon save you will be reriderced to the “Actions” page in the admin where conditions and actions can be configured. Actions can also be accessed via the List page.
For this example we need to configure the following:
“Add Condition” - to check form submission is from form which we are interested in
“Add Action” - to send the email to the customer
The final setup will look like below:
Condition is configured first, and the action is configured within the condition.
Add Condition
Add description to the condition, this will also be displayed in the action area in the admin as per the previous screenshot
Choose Condition Type = Template and add the following:
The above code snippet ensures the email notification is only send to customers that complete the form that has id = 7.
Form ID can be retrieved from the Forms module. Hover over the ‘edit’ pencil and check the link at the bottom of the page:
Click Save to save the condition
Add Action
Now navigate back to the actions and add a new action under the created condition. Actions can be accessed via the Hooks > List page:
Add a new action by clicking on the “Add Action” link under the created condition
Choose “Send Mail” action
Configure the action:
Add description
Unique Identifier
Set “From Email Address”
Set “From Name”
Set “To Email Address”
Set “To Name”
Set “Subject”
Set “Template file” from your BitBucket Repository or use the below “Template code” area
In order to send the email directly to the customer who submitted the email, update the “To Email Address” & “To Name” to pull the information about the customer from the submitted form:
The last step is to add the email notification HTML & CSS code in the Template Code area. This will determine the structure & style of the sent email.
Please find an eBook HTML template that can be used as a starting point:
https://drive.google.com/file/d/1bzaOkOx3L9-XRbnI1gy9HlYLlXpIc6F7/view?usp=sharing
Last step is to enable the Hook in the main Hooks > List area:
All form submissions can be viewed in the Interactions > Forms > Submissions area in the admin, while all sent emails can be viewed in the Interactions > Mailer > Emails area in the admin.