This issue is about creating an email builder that will be able to generate html and text using a template name, and some data.
For this we'll use Twig or an equivalent https://twig.symfony.com/ (twig is initialy for php so something else will be better)
[ ] Creates a email-pusher platform service if not already created by #2492
[ ] Create a function build(template: string, language: string, data: any): {html: string, text: string}
[ ] This function will automatically generate the html version. The text version will simply be the same as the html but without the html tags (find on google functions for that).
[ ] Each templates should be localised and we must extends a "master" template see example below
[ ] Create the _structure.twig.html and notification-digest.twig.html files following the design bellow
[ ] The subject of the email should be in an individual twig file or in special tags of the template file. The subject of the email will contain the company name, like "Missed notifications from Company A"
Note: templates structure is for each language, a _structure.twig.html and a [name of template].twig.html that extends it:
templates/
fr/
_structure.twig.html
notification-digest.twig.html
notification-digest.subject.twig.html #Optional, contains the subject / title of the email
en/
...
US: https://www.notion.so/linagora/Email-notification-deb6cac3b2a6480c840b44b8ac6d53f5
This issue is about creating an email builder that will be able to generate html and text using a template name, and some data.
For this we'll use Twig or an equivalent https://twig.symfony.com/ (twig is initialy for php so something else will be better)
build(template: string, language: string, data: any): {html: string, text: string}
Note: templates structure is for each language, a _structure.twig.html and a [name of template].twig.html that extends it:
Note: the design to implement (you'll find the figma here: https://www.figma.com/file/uLw3iWnOEGaRlJnfPz4Pv0/Twake.new?node-id=3332%3A165844):