Closed
Description
Description
The current solution allows for easy translation of email content since this is handled by Twig, but it still requires one to inject TranslatorInterface
into the place where email is being generated to be able to translate the subject as well.
We have a home grown implementation of this where email template consist of 3 blocks:
- subject
- body_text (optional)
- body_html
Email renderer then uses those block to set the subject, text and html portions of the email.
Seems like something that would be a nice improvement, although I see a possible issue since current implementation expects different templates for HTML and TEXT parts and having Subject in a separate file doesn't make sense IMHO.
Example
$email = (new TemplatedEmail())
->from('fabien@example.com')
->to(new Address('ryan@example.com'))
->template('emails/signup.twig')