You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you have an advanced template with a footer with a lot of information this has the downside, that probably the indentation is completely off. Also sometimes we just want to have a different templates for html and text.
Expected Behavior
It would be good to be able to define two separate templates.
Steps to Reproduce
Possible Solutions
Maybe we could have user_template and admin_template and additionally user_template_plain and admin_template_plain.
Or, my preferred option, we define it like user_template: community/email-confirmation-email and it will automatically try to find community/email-confirmation-email.html.twig and community/email-confirmation-email.txt.twig.
Also see: https://symfony.com/doc/current/mailer.html#text-content
I'm open to create a PR for my preferred approach.
Btw instead of new Email we could also use new TemplatedEmail.
The text was updated successfully, but these errors were encountered:
sulu_community:
webspaces:
website:
# ...registration:
# ...email:
subject: Registration# note there's no extension, it will load:# portal/email/auth/registration-email.html.twig as htmlTemplate# portal/email/auth/registration-email.txt.twig as textTemplateuser_template: portal/email/auth/registration-emailadmin_template: ~
Actual Behavior
Currently we can only define one email template per type (registration, email confirmation, ...).
If you use an HTML template Symfony will automatically generate a text version based on the following rules:
https://symfony.com/doc/current/mailer.html#text-content
When you have an advanced template with a footer with a lot of information this has the downside, that probably the indentation is completely off. Also sometimes we just want to have a different templates for html and text.
Expected Behavior
It would be good to be able to define two separate templates.
Steps to Reproduce
Possible Solutions
Maybe we could have
user_template
andadmin_template
and additionallyuser_template_plain
andadmin_template_plain
.Or, my preferred option, we define it like
user_template: community/email-confirmation-email
and it will automatically try to findcommunity/email-confirmation-email.html.twig
andcommunity/email-confirmation-email.txt.twig
.Also see: https://symfony.com/doc/current/mailer.html#text-content
I'm open to create a PR for my preferred approach.
Btw instead of
new Email
we could also usenew TemplatedEmail
.The text was updated successfully, but these errors were encountered: