diff --git a/apps/web/src/pages/templates/[id].tsx b/apps/web/src/pages/templates/[id].tsx index 1a23cd8..25b59a0 100644 --- a/apps/web/src/pages/templates/[id].tsx +++ b/apps/web/src/pages/templates/[id].tsx @@ -121,57 +121,35 @@ export default function TemplateEditorPage() { return ( -
+
{/* Header */} -
-
- -
-

Edit Template

-

Make changes to your email template

-
-
-
-
- {!hasChanges && !isSubmitting && ( - All changes saved - )} - {hasChanges && !isSubmitting && ( - Unsaved changes - )} -
-
- - -
+
+ +
+

Edit Template

+

+ {isSubmitting + ? 'Saving...' + : hasChanges + ? Unsaved changes + : 'All changes saved'} +

- {/* Template Editor */} -
- {/* Template Settings */} - + + {/* Row 1: Basic Info + Template Type */} +
+ - Template Settings - Configure the basic settings for your template + Basic Information + Name and describe your template -
- +
+
-
+
- -
- -
- {([ - {value: 'MARKETING', label: 'Marketing', description: 'Subscribed contacts, includes unsubscribe link'} , - {value: 'TRANSACTIONAL', label: 'Transactional', description: 'All contacts, no subscription check or footer'}, - {value: 'HEADLESS', label: 'Headless', description: 'Subscribed contacts, no Plunk footer'}, - ] as const).map(({value, label, description}) => ( - - ))} -
- {editedTemplate.type === 'HEADLESS' && !detectUnsubscribeSignal(editedTemplate.body ?? '') && ( -
-
- -

No unsubscribe link detected

-
-
-

- You are responsible for providing recipients a way to opt out. Use the Plunk variables below to build your own footer. -

-
- - {'{{unsubscribeUrl}}'} - - - {'{{manageUrl}}'} - -
-
-
- )} -
- -
- - setEditedTemplate({...editedTemplate, subject: e.target.value})} - required - placeholder="Welcome to our platform!" - /> -

Use {'{{variableName}}'} for dynamic content

-
- - setEditedTemplate({...editedTemplate, from: value})} - onFromNameChange={value => setEditedTemplate({...editedTemplate, fromName: value})} - onReplyToChange={value => setEditedTemplate({...editedTemplate, replyTo: value})} - fromNamePlaceholder={activeProject?.name || 'Your Company'} - layout="vertical" - /> + + + Template Type + Choose how this template should be treated + + +
+ {([ + {value: 'MARKETING', label: 'Marketing', description: 'Subscribed contacts, includes unsubscribe link'}, + {value: 'TRANSACTIONAL', label: 'Transactional', description: 'All contacts, no subscription check or footer'}, + {value: 'HEADLESS', label: 'Headless', description: 'Subscribed contacts, no Plunk footer'}, + ] as const).map(({value, label, description}) => ( + + ))} +
+ {editedTemplate.type === 'HEADLESS' && !detectUnsubscribeSignal(editedTemplate.body ?? '') && ( +
+
+ +

No unsubscribe link detected

+
+
+

+ You are responsible for providing recipients a way to opt out. Use the Plunk variables below to build your own footer. +

+
+ + {'{{unsubscribeUrl}}'} + + + {'{{manageUrl}}'} + +
+
+
+ )} +
+
+
+ + {/* Email Settings */} + + + Email Settings + Configure sender information and subject + + +
+ + setEditedTemplate({...editedTemplate, subject: e.target.value})} + required + placeholder="Welcome to our platform!" + /> +

Use {'{{variableName}}'} for dynamic content

+
+ + setEditedTemplate({...editedTemplate, from: value})} + onFromNameChange={value => setEditedTemplate({...editedTemplate, fromName: value})} + onReplyToChange={value => setEditedTemplate({...editedTemplate, replyTo: value})} + fromNamePlaceholder={activeProject?.name || 'Your Company'} + /> +
+
+ {/* Email Body */} - - Email Body - Create your email using the visual editor or paste custom HTML - - - setEditedTemplate({...editedTemplate, body})} - /> - - -
- + + Email Body + Create your email using the visual editor or paste custom HTML + + + setEditedTemplate({...editedTemplate, body})} + /> + +
+ + {/* Actions */} +
+ + +
+ +
{/* Sticky Save Bar */}