Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a human-friendly HTML template for mentions #9358

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

acelaya
Copy link
Contributor

@acelaya acelaya commented Feb 18, 2025

Depends on #9357

Closes #9355
Closes #9341

This PR brings the HTML template used in LMS for the email digest, and reuses the same structure for @mentions emails, but trying to more or less display the information from the original email design: https://www.figma.com/design/pwzOVmALQqBB8OFDeYTMTd/%40Mentions?node-id=331-2151&p=f&t=7ogj2TOnBfTnUDoC-0

image

Considerations and out of scope

  • When we set annotation.text_rendered, there's some markdown rendering and HTML sanitization that ends up stripping all data attributes from mention tags. This only affects how they are styled in the email, but I'll try address this separately. EDIT: To be addressed in Keep mention attributes when filtering annotation markdown #9361
  • The mention_notification unit test uses a jinja environment to test for potential syntax errors in the template. I had to mock one global jinja function there as a workaround, but I'll try to add a proper functional test as well. See the slack discussion for details.
  • The email is currently lacking unsubscribe or survey links. We still need to clarify those.

Test steps

  1. Checkout this branch.
  2. Create an annotation mentioning some user.
  3. See that the mail folder in h contains a file corresponding to the email notification for that mention.
  4. Open that file in a mail client, like Thunderbird, and verify it includes the information and links for said annotation.

@acelaya acelaya force-pushed the mention-email-html branch 5 times, most recently from 1fe8bbf to e89da98 Compare February 18, 2025 12:03
Base automatically changed from mention-email-preview to main February 18, 2025 13:40
@acelaya acelaya force-pushed the mention-email-html branch 5 times, most recently from 0421b3e to 6db614b Compare February 18, 2025 15:12
@acelaya acelaya requested review from mtomilov and seanh February 19, 2025 09:37
@acelaya acelaya marked this pull request as ready for review February 19, 2025 09:37
@acelaya acelaya requested a review from mtomilov February 20, 2025 14:33
* Add a human-friendly HTML template for mentions

* Keep mention attributes when filtering annotation markdown
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve mentions email notification template Render html in the annotation text
2 participants