feat(email): per-variant paid/unpaid body templates in settings
The previous single body field could not distinguish 'use the default' from 'save the pre-filled default', so the first settings save locked the hint in as a custom override for ALL orders — the paid/unpaid default logic never ran. Give each payment state its own editable body field (emailBodyHtmlDePaid / emailBodyHtmlEnPaid) with its own empty-fallback. A body submitted unchanged from its built-in default is stored as empty, so 'use default' survives saves and future default updates propagate.
This commit is contained in:
@@ -94,10 +94,14 @@ model ShopSettings {
|
||||
smtpReplyTo String @default("")
|
||||
|
||||
// Email templates (HTML, with {{var}} placeholders). Empty = use defaults.
|
||||
// The Body fields are the UNPAID (outstanding) variant; the *Paid fields are
|
||||
// sent for orders that are already settled (paid/refunded/voided).
|
||||
emailSubjectDe String @default("")
|
||||
emailBodyHtmlDe String @default("")
|
||||
emailSubjectEn String @default("")
|
||||
emailBodyHtmlEn String @default("")
|
||||
emailBodyHtmlDePaid String @default("")
|
||||
emailBodyHtmlEnPaid String @default("")
|
||||
|
||||
// Automations (webhook-driven, as a fallback to Shopify Flow which only
|
||||
// exposes custom-app actions on Plus stores).
|
||||
|
||||
Reference in New Issue
Block a user