Skip to content

feat: Use generated email templates#305

Open
hhvrc wants to merge 2 commits into
developfrom
feature/react-email-templates
Open

feat: Use generated email templates#305
hhvrc wants to merge 2 commits into
developfrom
feature/react-email-templates

Conversation

@hhvrc
Copy link
Copy Markdown
Contributor

@hhvrc hhvrc commented May 24, 2026

No description provided.

@hhvrc hhvrc self-assigned this May 24, 2026
Copilot AI review requested due to automatic review settings May 24, 2026 17:07
@hhvrc hhvrc added the feature New feature or request label May 24, 2026
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

Introduces a React-Email + pnpm-based source-of-truth for the API’s transactional SMTP templates and generates the Liquid files during dotnet build/publish, replacing the previously committed .liquid templates.

Changes:

  • Add API/SmtpTemplates Node workspace (React-Email templates + exporter) and supporting TypeScript config/docs.
  • Update API/API.csproj to (1) install template deps, (2) export .liquid files, and (3) include generated templates as publish/output content.
  • Update Docker/CI workflows to ensure Node + pnpm are available during builds that publish the API.

Reviewed changes

Copilot reviewed 20 out of 21 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
docker/API.Dockerfile Installs Node + pnpm in the API build stage so MSBuild template generation can run during publish.
API/API.csproj Adds MSBuild targets to install deps, export Liquid templates, and include generated .liquid files in output/publish.
API/SmtpTemplates/package.json Defines the React-Email workspace, scripts (dev/export), and pins toolchain/deps.
API/SmtpTemplates/pnpm-lock.yaml Locks Node dependencies for deterministic template builds.
API/SmtpTemplates/tsconfig.json TypeScript configuration for the template workspace.
API/SmtpTemplates/scripts/export-templates.ts Exports .tsx templates into dist/*.liquid with subject on line 1.
API/SmtpTemplates/README.md Documents how templates build via MSBuild and how to develop/export locally.
API/SmtpTemplates/.gitignore Ignores node_modules, build outputs, and React-Email dev artifacts.
API/SmtpTemplates/emails/EmailVerification.tsx React-Email version of the email verification template.
API/SmtpTemplates/emails/PasswordReset.tsx React-Email version of the password reset template.
API/SmtpTemplates/emails/EmailChangeNotice.tsx React-Email version of the email change notice template.
API/SmtpTemplates/emails/AccountActivation.tsx React-Email version of the account activation template.
API/SmtpTemplates/emails/_lib/components.tsx Shared React-Email building blocks (layout, paragraph, CTA button, etc.).
API/SmtpTemplates/emails/_lib/styles.ts Shared inline style definitions for templates.
API/SmtpTemplates/emails/_lib/placeholders.ts Utility to convert sampleProps keys into Liquid placeholders during export.
API/SmtpTemplates/EmailVerification.liquid Removes committed Liquid template (now generated).
API/SmtpTemplates/PasswordReset.liquid Removes committed Liquid template (now generated).
API/SmtpTemplates/EmailChangeNotice.liquid Removes committed Liquid template (now generated).
API/SmtpTemplates/AccountActivation.liquid Removes committed Liquid template (now generated).
.github/workflows/ci-build.yml Installs Node + pnpm in CI because API build/test now generates templates.
.github/workflows/codeql.yml Installs Node + pnpm for CodeQL job because API publish now generates templates.
Files not reviewed (1)
  • API/SmtpTemplates/pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread API/API.csproj

<Target Name="InstallEmailTemplateDeps"
Inputs="$(SmtpTemplatesDir)\package.json;$(SmtpTemplatesDir)\pnpm-lock.yaml"
Outputs="$(SmtpTemplatesDir)\node_modules\.package-lock.json">
Comment thread docker/API.Dockerfile

# Node + pnpm: required by the API.csproj MSBuild target that renders the
# React-Email templates to SmtpTemplates/dist/*.liquid during publish.
RUN apk add --no-cache nodejs npm \

export function AccountActivation(props: AccountActivationProps) {
return (
<Layout heading="Active your account!">
Comment on lines +52 to +58
# API.csproj builds the React-Email templates during dotnet build/test.
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version: '20'
cache: 'pnpm'
cache-dependency-path: API/SmtpTemplates/pnpm-lock.yaml
Comment on lines +44 to +50
# API.csproj builds the React-Email templates during dotnet publish.
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version: '20'
cache: 'pnpm'
cache-dependency-path: API/SmtpTemplates/pnpm-lock.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants