Setup
-
Firstly, copy
Automagic
intosite/addons/
. -
Well, this is awkward... there's no step 2.
Usage
Inside an email template, use the {{ automagic }}
tag pair to loop over the available data
from the submission.
Parameters
Name | Description | Example |
---|---|---|
exclude |
A pipe-delimited list of variables to exclude. | {{ automagic exclude="name|email" }} |
remove_empty |
Remove empty fields from being output. | {{ automagic remove_empty="true" }} |
Variables
Name | Description |
---|---|
key |
Formset field key. |
value |
Form submission value. |
display |
A titlized version of the key for display purposes. |
Note: The submission ID and Date are automatically appended.
Example
Template
{{ automagic }}{{ display }}: {{ value }}{{ /automagic }}---{{ automagic }}<p> <strong>{{ display }}:</strong> {{ value }}</p>{{ /automagic }}
Submission Data
name: Michael Scottcompany: Dunder Mifflinposition: Regional Manageraddress: 1725 Slough Avenue, Scranton, PA
Output
Name: Michael ScottCompany: Dunder MifflinPosition: Regional ManagerAddress: 1725 Slough Avenue, Scranton, PAID: 1541603055.1894Date: November 7th, 2018---<p> <strong>Name:</strong> Michael Scott</p><p> <strong>Company:</strong> Dunder Mifflin</p><p> <strong>Position:</strong> Regional Manager</p><p> <strong>Address:</strong> 1725 Slough Avenue, Scranton, PA</p><p> <strong>ID:</strong> 1541603055.1894</p><p> <strong>Date:</strong> November 7th, 2018</p>
Example Templates
Full template based on Postmark Transactional Email Templates.