A templating system was needed for the app. In order to make it easy to use and also responsive, two libraries has been used :
Two templating libraries are used, they allow easy editing and responsive :
-[Handlebars](https://handlebarsjs.com/)
-[MJML](https://mjml.io/)
-[Handlebars](https://handlebarsjs.com/) is used as a semantic template motor. It allow us to split email template in order to reuse some parts (header, footer ...)
Handlebars is used as a semantic template motor. It allow us to split email template in order to reuse some parts (header, footer ...)
Mjml is a lib providing a syntax allowing developers to easily build responsive templates.
-[MJML](https://mjml.io/) is a lib providing a syntax allowing developers to easily build responsive templates.
-[Mjml live editor](https://mjml.io/try-it-live/bohYnxKkCq-)
## Bounce token
A bounce token stored in the profile of each user is sent in email. It allows us to track if user clicks on links.
## Unsubscribe
A user can unsubscribe to our newsletter by a link in each mails. It **does not** require authentication. This link is built with a `sharecode` token that contains specific permissions to turn off the `sendAnalysisNotification` property in the user profile.