Hello All,
We are deploying our first Drupal 8 site. While in development, we seem to have run into a minor issue, which I can not find any documentation on.
It does not seem that there is ANY WAY to have HTML properly formatted within an outbound email.
Is there a tutorial, or how-to on this somewhere? Am I the ONLY one struggling with having the outbound emails be in HTML?
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | patch_1.txt | 738 bytes | branimirpetkov |
Comments
Comment #2
robertoperuzzoI have the same problem: I can't send HTML body email.
I've noticed a weird thing in SwiftMailer.php class at line 645:
So I think my email body isn't "safe". So I wonder "How can I make it safe?".
Thanks.
Comment #3
duneblI confirm that I couldn't get formatted emails:
I can see that the emails are using my twig template,s but unfortunately most of html tags are removed (but does exist in the twig)
If I remember well this was working well few months ago... now I discover the problem
Comment #4
branimirpetkov commentedTemporary patch for the issue at hand.
Comment #5
branimirpetkov commentedFixed the error about Self-closing XHTML tags are ignored.
Comment #6
branimirpetkov commentedAdded multiple tags support for different uses
Comment #7
taiger commentedThe patch in #6 works but it seems like this module should be allowing and exposing filter formats for system emails at admin/config/people/accounts.
For now, using this patch allows html to be in the body of the email. Thanks!
Comment #8
alemadleiI confirm that #6 works for me, though an ideal solution would be to allow picking the text format used for emails.
Comment #9
jeffschulerIn Message settings ( admin/config/swiftmailer/messages ), have you tried setting "Respect provided e-mail format"?
As that option's descriptive text suggests: "Unless your site somehow alters e-mails, enabling this setting will result in all e-mails to be sent as plain text as this is the content type Drupal by default will apply to all e-mails."
Also, see #3016912: Add a setting to apply a HTML filter about associating text format with mail format.
Comment #10
pranav45 commentedThanks @branimirpetkov,patch from #6 works for me too.
Comment #11
adamps commentedThis issue seems to be a mixture of
Let's close it in favour of #3122389.