diff --git a/packages/features/ee/workflows/lib/reminders/templates/customTemplate.ts b/packages/features/ee/workflows/lib/reminders/templates/customTemplate.ts index 27c5c421a4..1966c2eb7c 100644 --- a/packages/features/ee/workflows/lib/reminders/templates/customTemplate.ts +++ b/packages/features/ee/workflows/lib/reminders/templates/customTemplate.ts @@ -30,6 +30,11 @@ export type VariablesType = { eventEndTimeInAttendeeTimezone?: Dayjs; }; +// Replaces placeholders like {EVENT_NAME_VARIABLE} with {EVENT_NAME} +function replaceVariablePlaceholders(text: string) { + return text.replace(/\{([A-Z0-9_]+)_VARIABLE}/g, (_, base) => `{${base}}`); +} + const customTemplate = ( text: string, variables: VariablesType, @@ -46,6 +51,8 @@ const customTemplate = ( let locationString = variables.location || ""; + text = replaceVariablePlaceholders(text); + if (text.includes("{LOCATION}")) { locationString = guessEventLocationType(locationString)?.label || locationString; }