feat(templates): add support for HTML templates
This commit is contained in:
committed by
Linus Rath
parent
0b62afb0f8
commit
0a30b2fb3a
@@ -20,6 +20,7 @@ function makeTemplate(overrides: Partial<EmailTemplate> = {}): EmailTemplate {
|
||||
name: 'Test Template',
|
||||
subject: '',
|
||||
body: '',
|
||||
isHTML: false,
|
||||
category: '',
|
||||
isFavorite: false,
|
||||
createdAt: '2026-01-01T00:00:00Z',
|
||||
|
||||
@@ -3,6 +3,7 @@ export interface EmailTemplate {
|
||||
name: string;
|
||||
subject: string;
|
||||
body: string;
|
||||
isHTML?: boolean;
|
||||
category: string;
|
||||
defaultRecipients?: {
|
||||
to?: string[];
|
||||
|
||||
@@ -173,7 +173,8 @@ export function importTemplates(json: string): ImportResult {
|
||||
id: generateUUID(),
|
||||
name: sanitizeText(t.name),
|
||||
subject: sanitizeText(t.subject),
|
||||
body: sanitizeText(t.body),
|
||||
body: t.isHTML ? String(t.body || '') : sanitizeText(t.body),
|
||||
isHTML: Boolean(t.isHTML),
|
||||
category: sanitizeText(t.category),
|
||||
defaultRecipients: recipients && typeof recipients === 'object'
|
||||
? {
|
||||
|
||||
Reference in New Issue
Block a user