fix(email): preserve personalization tokens for template rendering
This commit is contained in:
1 parent
8bc8fe85c3
commit
e1ea6e2977
5 files changed
+41
-3
No files matched your search
@@ -110,6 +110,8 @@ export async function renderEmail(
|
||||
direction?: "ltr" | "rtl";
|
||||
variables?: Record<string, unknown>;
|
||||
requireVariables?: boolean;
|
||||
/** Preserve allowlisted tokens and fallbacks for template export, never for final delivery. */
|
||||
preserveVariables?: boolean;
|
||||
countdownImageUrl?: string;
|
||||
/** Trusted host injection; never sourced from the editable document. */
|
||||
ampValidator?: (content: string) => Promise<ValidationReport>;
|
||||
@@ -118,6 +120,7 @@ export async function renderEmail(
|
||||
): Promise<Result<EmailRenderBundle>> {
|
||||
const personalized = resolveDocumentVariables(document, emailKind.variables, options.variables, {
|
||||
requireValues: options.requireVariables,
|
||||
preserveTokens: options.preserveVariables,
|
||||
});
|
||||
if (!personalized.ok) return personalized;
|
||||
if (options.countdownImageUrl) {
|
||||
|
||||
Reference in new issue
Block a user