How to create a new email template
Copy the link to the article
Copied

To add a new email template, click on the button of the same name.

Let's take a look at some of the fields that need to be filled in:

From. The field can contain both the address itself, for example, info@site.uk, or an extended entry of the form: Jack Daniels <info@site.uk>.

Where to use. Determines where the template will be available and what objects will be available in it.

To. The email address where the created email will be sent. You can specify both the actual address (demo@demo.uk) and a variable that will substitute the address, for example, from the order - {{ order.anyEmail }}.

Note

In the "To" field, you can specify several recipient addresses. Addresses are separated by commas, for example: demo@demo.uk, {{ order.anyEmail }}. If several recipients are specified in the template, then the emails will be displayed for each recipient separately.

Subject. The subject is specified as plain text or as a twig-template. For example: "New order on the site {{ order.site.url }}". All available objects can be viewed in the corresponding reference.

Text template. Set as text using HTML and Twig.

Example of writing a text template in HTML:

<p>Dear {{ order.nickName }}, </p>

<p>Your order № {{ order.number }} has been confirmed. The request was received for processing at the warehouse.</p>
<p>You can sleep in peace :) We will inform you about the status of the order. If you want to change the delivery date or time, please email us or call {{order.site.phones|international_phone}}.</p>
<p>When contacting the operator of the online store, do not forget to give your order number</p>

Don't forget to specify an unsubscribe link. An example of using the tag: <unsubscribe>Unsubscribe from the mailing</unsubscribe>

To debug the email use the instructions below:

  1. When creating and editing an email template, where a list of products is displayed through the cycle for - you cannot edit the template when the visual editor is enabled.
  2. When displaying the date, be it the delivery date order.deliveryDate or the order creation date order.createdAt - in all cases the date filter |date("d.m.Y") is mandatory.

That is, the delivery date parameter will look like this: order.deliveryDate|date("d.m.Y"), and the order creation parameter will look like this: order.createdAt|date("d.m.Y").

Checking that the template is displayed correctly can be carried out using the following steps:

  1. Go to the page for editing the email template.
  2. Copy the source code of the template.
  3. Go to the order (you can use a test order in which all or most of the fields are filled in), go down to the "Communications" block and click the "New email" button.
  4. In the window that opens, paste our copied source code.
  5. Click the "Preview" button.

When editing, you can attach the file to the email template.

Be sure to specify the extension for the attached file. Otherwise, an error will occur when saving.

Thank you for your feedback.
Was this article helpful?
No
  • Рекомендации не помогли
  • Нет ответа на мой вопрос
  • Текст трудно понять
  • Не нравится описанный функционал
Yes
Next article
How to attach a printed form to an email template
This article explains how to attach a printed form to an email template so that it can be sent as an email attachment.