◢◢ Emails
Transactional emails in the system are sent via two methods:
- Postmark from the strapi backend
- auth0 for all authentication related emails
Postmark
We defer all templating logic to Postmark and store the templates on their server. Any emails that need to be sent therefore only require to select the TemplateAlias of a template that has been created on Postmark.
Modifying a template
If you wish to make a change to the styling or the copy of the template, ensure you follow the steps below:
- Make any changes to the templates on the Sandbox server
- Send a test email from within the template, setting the correct variables
- If happy with the above changes, click Push to another server and select Just About Production
A couple of warnings:
- Do not change templates directly on the production server without testing on the sandbox first.
- Do not change the variable names without changing on the backend first. I would suggest making the backend change sending through both the new and old variable and then pushing to production.
Creating a template
If you wish to make a new template for a new type of email, follow the steps below:
- Go to the Sandbox server and click on "Add template".
- Choose a layout or create a new layout, these are intended to keep all the styling the same across emails
- Write your new code, make sure to test on previews and with Litmus to avoid any "dark-mode-egg-on-face" moments
- Set a
TemplateAlias that is easily recognisable e.g. banned-user
- If happy with the above changes, click Push to another server and select Just About Production
- In the backend code, you can now use the
TemplateAlias when sending the email, making sure you send in the correct TemplateModel aka vars
A couple of warnings:
- Do not try and use a
TemplateAlias that does not exist yet
- Ensure you send all the vars
- Always test on the Sandbox server first!