Appearance
CP Overview
On the CP page you can modify a couple of things. The module has three pages: Templates, Settings and Logging.
Settings
Email from
The From address of the emails (From in the CP, required). This is the same setting as the Email from setting of the Store module: when Store Email is installed, the email settings are no longer shown in the Store settings but are managed here.
Email from Name
The from name of the emails (From name in the CP, required). Just like Email from, this is shared with the Store module.
Log
What should be logged in the Logging overview: only errors, Everything or Nothing. Store Email only writes errors to this log, so Everything currently logs the same as only errors.
Templates
Here you can create the email templates.

The overview shows every template with its to address, subject, attachments, triggers and whether it's enabled. Click the label to edit a template, or use Add template to create a new template.
Available from v2.0.0:
- Filter the templates on
enabledor search on a keyword in the label, subject and to address, and choose how many templates are shown per page. - Select templates with the checkboxes and choose
Enable,DisableorDeletein thewith selectedbar to change them at once. - Use
Duplicatein the actions menu (the three dots) of a template to create a new template with the same settings. The copy is namedCopy of <label>and is disabled, so it doesn't send the same email twice; it's only created when you save the form.
When the module is installed, two templates are created for you, based on the order confirmation email template of the Store module:
Order confirmation: triggered when the status isCompleteand the order is paid.Order confirmation (awaiting payment): triggered when the status isPendingand the order is not paid, e.g. an order with the Manual gateway (Available from v2.0.0).
See How does it work.

Label
Give your template a logical name. Used in the list of templates.
Enabled
Is the template enabled, e.g. can we use it for sending?
Trigger on (Status)
Select the status that will trigger this email. You can select multiple statuses: Complete, Pending, Failed, Expired, Cancelled, Refunded and Paid chargeback. Leave empty to ignore this trigger.
Trigger on (Is Paid)
Select if this email should be triggered on the is_paid status: Yes (the order is paid), No (the order is not paid) or --- to ignore this trigger.
Trigger on (Is Shipped)
Select if this email should be triggered on the is_shipped status: Yes (the order is shipped, the same as {order:is_shipped} in the Store, so it includes orders shipped through add-ons like MyParcel or Pickup), No (the order is not shipped) or --- to ignore this trigger.
Trigger on (Payment method)
Available from v2.0.0
Only send this email for orders with one of the selected payment methods. You can select multiple payment methods. Leave empty to ignore this trigger.
You can choose from the gateways that are set up in the Store and the gateways of existing orders, for example an imported order or a gateway you no longer use.
This trigger narrows down the other triggers, so a template also needs a status, is_paid or is_shipped trigger. A gateway you add later is not selected automatically: templates with this trigger don't send an email for its orders until you select it.
Subject
The subject of the email, for example Order {order_id} is {status_label}. {status_label} is the label of the status (for example Complete), {status} the status itself (for example complete), just like in the Content.
The subject is parsed with the same variables as the Content, so other variables like {customer_first_name} work as well. Conditionals and tags are not parsed in the subject.
To
The email address where the email should be sent to. Enter a single email address or {customer_email} to send the email to the customer of the order.
Bcc
Enter one or more BCC email addresses, separated by a comma (at most 255 characters in total).
Content
The content of the email. You can use all variables from the Order Tag. But without the prefix {order:}, just like {customer_first_name}
ExpressionEngine tags in the values of the order variables (for example in a name or note the customer typed) are not parsed, they end up as plain text in the email. In an HTML template the values are HTML-escaped as well, so HTML the customer typed is shown as text (entities that are already in a value, like &, are kept as they are). The same goes for {invoice_url} and {to}, which can contain what the customer entered in the checkout.
See Template variables for the extra variables. The content is parsed as an ExpressionEngine template, so you can use conditionals, global variables and other tags as well.
When you save the template, the content is parsed with a test order. If it can't be parsed, you get the error Your template could not be parsed. Please check your syntax and the template is not saved. The validation runs through the action URL of the site. When that request fails, you get the error Your template could not be checked, because the site could not reach its own action URL: ... with the reason, see How does it work.
Mail Type
Set the type of email. This can be HTML or Plain text
Word Wrapping
Enable or disable word wrapping for the email: with word wrapping, ExpressionEngine breaks long lines of a plain text email (and of the plain text version of an HTML email) at 76 characters.
WARNING
Before 2.0.0 this setting was not applied: word wrapping was always enabled.
Include Confirmation PDF
If enabled, the order confirmation will be attached as a PDF to the email.
Include Invoice PDF
If enabled, the invoice will be attached as a PDF to the email.
When is an email sent?
The templates are checked every time something happens with an order in the Store module:
- an order is finished
- the status of an order changes
- the
is_paidflag of an order changes - the shipping status of an order changes
On a change only the templates with a trigger on what changed are checked: a status change checks the templates with a status trigger, a paid change those with an is_paid trigger and a shipping status change those with an is_shipped trigger. A finished order checks all templates (from v2.0.0). For orders created in the CP of Store, see How does it work.
An enabled template is sent when all triggers that are set on the template match the order. Triggers that are left empty are ignored, but at least one status, is_paid or is_shipped trigger must be set: a template without one can't be saved, also not with only a payment method. For example, a template with the status Complete and is_paid Yes is only sent when the order is complete and paid.
Every template is sent only once per order (a failed send is tried again on the next change of the order that the template has a trigger on). When you click the resend button of an order in the Store module, all templates that match the order are sent again, even if they were already sent.
Every email that is sent (or failed to send) is logged in the log of the order in the Store module, depending on the Log setting of the Store module: a successful send is only logged when it's set to Everything. See How does it work for the full flow.
TIP
When Store Email is installed, the Store module doesn't send its own order confirmation email anymore. Use a template (like the Order confirmation template that is created on install) instead.
Template variables
Next to the variables from the Order Tag (without the order: prefix), the following variables can be used in the Subject and Content:
| Variable | Description |
|---|---|
{site_name} | The name of the site |
{site_url} | The URL of the site |
{invoice_url} | The URL of the order page (the return URL + hash), empty when the order has no return URL |
{subject} | The subject of the email, with its variables (like {order_id}) replaced |
{to} | The email address the email is sent to (the email address of the order for {customer_email}) |
{bcc} | The BCC address(es) |
{from} | The from address |
{from_name} | The from name |
Example:
html
<p>Dear {customer_first_name},</p>
<p>Thank you for your order #{order_id}.</p>
<table>
{items}
<tr>
<td>{items:qty}x {items:name}</td>
<td>{items:price_total_plus_tax:formatted}</td>
</tr>
{/items}
</table>
<p>Total: {total_plus_tax:formatted}</p>
<p><a href="{invoice_url}">View your order</a></p>Logging
This is where you can track all error logs. Which messages are logged depends on the Log setting. Use Delete all logs to clear the log of the current site.
Available from v2.0.0
Filters
Filter the logs on severity (Error or Notice), on a date (a period like the last 24 hours, or your own date range) or search on a keyword in the message. You can also choose how many logs are shown per page. The filters stay active when you sort or go to another page.
Bulk delete
Select logs with the checkboxes and choose Delete in the with selected bar to delete them at once.
Export
Export logs downloads the logs as a CSV file (separated by ;). The export uses the active filters, so you only get the logs you see in the overview (all pages).
