Email Templates
Using this extension it is possible to let Symphony send pretty emails using XSLT.
General
Email mass mailings
Email templates are not intended for sending mass mailings. Since Google and Yahoo have required a DMARC entry since February 2024 and Microsoft since 2025, a professional mailing service such as rapidmail or mailjet should be used for this purpose.
Templates created by this extension are similar to traditional Symphony pages. Just like with normal pages, you can attach datasources, whose XML you can process using XSLT.
However, there are a few differences, too. Most emails will consist of two layouts: HTML
and Plain
. Every template created by the ETM has the option to select one or two layouts. For each layout, you will be able to set an XSLT template.
Warning: although it is possible, sending HTML-only emails is not recommended.
Parameters
If you are using filters, the ETM will automatically add a few parameters that you can use to filter your datasources:
$etm-entry-id
will contain the id of the entry inserted by the event.
You can use this parameter to filter a datasource and to email the data entered by the user.$etm-recipient
will contain the email address of the recipient of the email.
If you are sending to more than one person, the ETM will loop over your recipients, and set this value for every email.
Again, you will be able to filter your datasources with this parameter to include more information about the recipient.
Email delivery method
Email delivery
By default, emails are sent via sendmail
. Many mailbox providers treat these emails as unsafe and deliver them to the SPAM folder. Therefore, switch the email delivery method to SMTP
in the “Preferences”.
You may override Symphony’s “From Name” and “From Email Address” preferences. Changing the name can often be useful, but faking the email address is dangerous and will not work (or be restricted to certain addresses) with most SMTP accounts.
Create a new email template
To create a new email template, go to “Blueprints” → “Email Templates” → “Create New”.
Naming
Choose clear and descriptive names so that the purpose of the email template is immediately recognizable. This will help keep your project structured and maintainable, especially as it grows.
- Enter a name for the email template.
- Choose the data source, that contains the entry’s nodes.
- Choose a layout:
HTML and Plain
HTML only
(not recommended)Plain only
- Email Settings:
- Type in a Subject for the email
- Select multiple recipients by separating them with commas. Dynamic values are also supported:
{/data/authors/author/name}
<{/data/authors/author/email}>
will return: Name <email@domain.com> - Type in the From name or leave blank to choose the From name saved in the Symphony “Preferences“
- Type in an Email-From-Address or leave blank to choose the Email-From-Address saved in the Symphony “Preferences“ (Faking this address is dangerous. It may cause issues with spam filters and even break sending, especially via SMTP)
- Type in Reply-To Name (
optional
) - Type in Reply-To Email Address (
optional
) - Type in Attachments (
optional
). Select multiple attachments by separating them with commas. For each file define either a URL or a local path starting from theDOCROOT
, e.g./workspace/media/foo.pdf
. It is also possible to include dynamic parts (e.g. parameters from your data source). URLs and local paths must not contain commas
- Create the template by clicking the button ”Create Template”.
Read also the example “Contact form”.