refactor(mail): give the emails their own Twig environment
The six email templates move to @theme/emails/*.twig and are rendered by an
environment of their own: a message has no request behind it, so nothing of the
visitor, the csrf token or the build assets is offered there, and every address
it prints is absolute.
- MailRenderer takes the locale as an argument and puts the translator of the
process back afterwards, so a batch of messages in different languages leaves
nothing behind; EmailSender no longer mutates a shared engine
- a row queued before this change still names its Plates template and is mapped
to the Twig one of the same name
- twig:lint, twig:compile and i18n:scan pick the environment a template belongs
to, otherwise the mail functions read as unknown to them
environment of their own: a message has no request behind it, so nothing of the
visitor, the csrf token or the build assets is offered there, and every address
it prints is absolute.
- MailRenderer takes the locale as an argument and puts the translator of the
process back afterwards, so a batch of messages in different languages leaves
nothing behind; EmailSender no longer mutates a shared engine
- a row queued before this change still names its Plates template and is mapped
to the Twig one of the same name
- twig:lint, twig:compile and i18n:scan pick the environment a template belongs
to, otherwise the mail functions read as unknown to them