Skip to content

feat: add pug email template preview functionality - #1692

Draft
jekabs-karklins wants to merge 1 commit into
developfrom
SWAP-5695-preview-functionality-for-pug-template-emails
Draft

feat: add pug email template preview functionality#1692
jekabs-karklins wants to merge 1 commit into
developfrom
SWAP-5695-preview-functionality-for-pug-template-emails

Conversation

@jekabs-karklins

@jekabs-karklins jekabs-karklins commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Description

This PR introduces email template preview functionality, allowing users to view how email templates will render before they are sent.

Motivation and Context

The need for this change arose from a lack of visibility into how email templates would appear when sent. This functionality will provide users with a preview of the email, reducing errors and enhancing user experience.

Changes

  1. Refactored the SMTPMailService class to enable email template rendering.
  2. Introduced new queries in EmailTemplateQueries to handle email template preview requests.
  3. Added a new resolver EmailTemplatePreviewQuery to fetch and render email template previews.

How Has This Been Tested?

Fixes Jira Issue

https://jira.ess.eu//browse/SWAP-5695

Depends On

Tests included/Docs Updated?

  • I have added tests to cover my changes.
  • All relevant doc has been updated

- Implemented EmailTemplatePreviewQuery to handle email template preview requests.
- Created EmailTemplatePreview and EmailTemplatePreviewError types for structured response.
- Developed emailTemplateRenderer utility to render email templates using Pug.
- Added tests for email template rendering and variable substitution.
- Integrated CodeMirror for editing Pug templates in the frontend.
- Created EmailTemplatePreview component to display rendered email previews.
- Added debounced input handling for preview updates.
- Implemented variable detection for Pug templates to assist in previewing.
- Updated frontend components to support new email template features.
@jekabs-karklins jekabs-karklins changed the title feat: add email template preview functionality feat: add pug email template preview functionality Jul 30, 2026
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.

1 participant