Skip to content

Issue #2097: Enable HTML support for email templates.#2112

Open
jameswsullivan wants to merge 3 commits into
TexasDigitalLibrary:mainfrom
jameswsullivan:enable-mime-html-email
Open

Issue #2097: Enable HTML support for email templates.#2112
jameswsullivan wants to merge 3 commits into
TexasDigitalLibrary:mainfrom
jameswsullivan:enable-mime-html-email

Conversation

@jameswsullivan
Copy link
Copy Markdown
Contributor

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.

@cstarcher
Copy link
Copy Markdown
Member

cstarcher commented Oct 30, 2025

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.

@jameswsullivan
Copy link
Copy Markdown
Contributor Author

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.
I'm guessing since this is not quite urgent, might table this for a future version or something, along with other potential accessibility changes?

@cstarcher
Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 MimeMessageHelper to 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);
Comment on lines 87 to 89
mm.setSubject(subject);
mm.setText(content, false);
mm.setText(content, true);

@smutniak smutniak mentioned this pull request May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable HTML support for email templates.

3 participants