Where templates live
All email templates are insrc/Acme.Infrastructure/Email/Templates/. Each template is a C# class that extends EmailTemplateBase.
How templates work
EmailTemplateBase provides:
- The outer HTML envelope (DOCTYPE,
<head>, brand color, inline styles) - Header with the application name
- Footer with unsubscribe language
- Abstract
RenderContent()method that each template implements
RenderContent() with its specific body HTML:
Changing the brand color
The primary color is set in one place inEmailTemplateBase:
Changing email copy
Find the relevant template class, edit the string inRenderContent(). The C# raw string literal ("""...""") makes multi-line HTML easy to write and read.
Adding a logo
Replace the text-based header inEmailTemplateBase.RenderHeader() with an <img> tag:
Adding a new template
Step 1: Add a value to theEmailTemplate enum in Domain:
ResendEmailService.SendTemplateAsync:
Testing email rendering locally
Dump a template to HTML and open it in a browser — no SMTP server needed:/tmp/weekly-digest-preview.html in your browser. Delete this code before committing.
For sends that actually went through, check the Emails tab in the Resend dashboard — it shows the full rendered HTML, delivery timestamp, and open/click events.