export const renderNotificationTemplate = (template: string, variables: Record) => template.replace(/\{\{([a-zA-Z0-9_]+)\}\}/g, (_match, key: string) => variables[key] ?? `{{${key}}}`) export const renderNotificationActionUrlPreview = (template: string, variables: Record) => template.replace(/\{\{([a-zA-Z0-9_]+)\}\}/g, (_match, key: string) => { const value = variables[key] return value === undefined ? `{{${key}}}` : encodeURIComponent(value) })