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

feat: introduce html mails #2045

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

feat: introduce html mails #2045

wants to merge 5 commits into from

Conversation

bjoern-m
Copy link
Contributor

@bjoern-m bjoern-m commented Feb 7, 2025

Description

This PR introduces support for HTML email rendering and delivery alongside plain text emails. The changes ensure that both plain text and HTML versions of passcode and notification emails are generated and sent, improving email formatting and readability across different clients.

Implementation

  • Passcode Email Handling

    • Refactored SendPasscodeResult to separate BodyPlain and BodyHTML.
    • Updated SendPasscode to generate both plain text and HTML email bodies.
    • Modified ReSendPasscode and SendPasscode hooks to handle BodyPlain and BodyHTML separately.
  • Email Service Enhancements

    • SendEmail now accepts an additional htmlBody parameter and includes an alternative HTML part.
    • Introduced RenderBodyPlain and RenderBodyHTML methods for rendering text and HTML templates separately.
  • Template System Updates

    • Refactored email template handling to distinguish .txt.tmpl (plain text) and .html.tmpl (HTML).
    • Added layout.html.tmpl for consistent HTML email structure.
    • Introduced new HTML versions of existing notification emails (e.g., email_verification.html.tmpl).
  • Handler Updates

    • Updated PasscodeHandler to render both plain text and HTML emails.
    • Ensured that webhook notifications include both BodyPlain and Body (HTML).

Todos

  • Test email rendering across various email clients to ensure compatibility.

@bjoern-m bjoern-m force-pushed the feat-introduce-html-mails branch from 453d89f to 085da5d Compare February 7, 2025 08:45
@bjoern-m bjoern-m force-pushed the feat-introduce-html-mails branch from 085da5d to 1669085 Compare February 7, 2025 09:26
@bjoern-m bjoern-m marked this pull request as ready for review February 7, 2025 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 New
Development

Successfully merging this pull request may close these issues.

2 participants