In this tutorial we will demonstrate how to customize the email content sent the users. The Web Cube system uses Flat emails to notify users that some change has occurred with their user account or an order they've placed.
Flat emails content can be customized using the Content text boxes or by using a custom template. Custom templates can be created using DB Templates. For more information on how to create DB Templates click here.
For this tutorial we will use an existing flat email called order-shipped. This flat email is used to send a message to the customer the order has been shipped.
1. Click on the CMS tab.
2. Click on the Emails then on the Flat emails menu items.
3. Click on the order-shipped flat email.
4. Edit the Content text box to customize the message of the email.
5. Beneath the main content, there are Alternative Content objects. These are used to store the HTML representation or other representations of the email. When an email is sent, it is a multipart document. That means that the plain text version and the HTML version can both be sent, and the email client (gmail, outlook, etc) can then decide which version of the content to present.
To customize the Alternative Content edit the Content Text box.
6. As you might have noticed this alternative content is using the template flatemails/order-summary.html. To customize this template we need to add it to the DB Templates.
a. Click on the CMS tab.
b. Click on the Templates menu items.
c. Click on the Add template button.
d. In the Name text filed add the template path flatemails/order-summary.html.
e. Leave the Content text box empty.
f. Select the sites where this template will be active. Hold down Control, or Command on Mac, to select more than one site then click on the blue arrow to move your selection on the Chosen sites column.
g. Click on the Save and continue editing button.
h. Edit the content of the template. One important thing notice is that this template it's used also by other flat emails so changing this template will affect the look and feel of other flat emails. If that's not the desired effect rename this template then reference the renamed template in the flat email.