Issue #2097: Enable HTML support for email templates.#2112
Issue #2097: Enable HTML support for email templates.#2112jameswsullivan wants to merge 3 commits into
Conversation
|
This solution modifies the formatting of all of the default email templates. We either need a different solution that does not modify the defaults or an implementation that updates the default templates when upgrading to work with this solution. |
|
Yep, that was what I was worried about too. I did this only as a test at first to see if it was possible to do "link over text" in an email template. |
|
Yes, I'm not opposed to adding this functionality in a future release. I just want to make sure it doesn't break current functionality. |
There was a problem hiding this comment.
Pull request overview
This PR changes the email-sending implementation so that email template content is sent as HTML, enabling templates to include markup such as accessible link text (<a href=...>label</a>), per Issue #2097.
Changes:
- Switch
MimeMessageHelperto multipart mode. - Send the email body using
MimeMessageHelper#setText(..., true)(HTML mode).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| MimeMessage message = createMimeMessage(); | ||
| MimeMessageHelper mm = new MimeMessageHelper(message); | ||
| MimeMessageHelper mm = new MimeMessageHelper(message, true); |
| mm.setSubject(subject); | ||
| mm.setText(content, false); | ||
| mm.setText(content, true); | ||
|
|
Resolves Issue 2097.
I'm a bit hesitant on this one though because it probably requires the admins and users to review and edit all of their existing email templates, as some formatting might not appear correctly without the HTML tags.