diff --git a/apps/worker/src/app/workflow/usecases/send-message/send-message-chat.usecase.ts b/apps/worker/src/app/workflow/usecases/send-message/send-message-chat.usecase.ts index 4a710fca18d..286885c7166 100644 --- a/apps/worker/src/app/workflow/usecases/send-message/send-message-chat.usecase.ts +++ b/apps/worker/src/app/workflow/usecases/send-message/send-message-chat.usecase.ts @@ -89,12 +89,14 @@ export class SendMessageChat extends SendMessageBase { let content = ''; try { - content = await this.compileTemplate.execute( - CompileTemplateCommand.create({ - template: step.template.content as string, - data: this.getCompilePayload(command.compileContext), - }) - ); + if (!command.chimeraData) { + content = await this.compileTemplate.execute( + CompileTemplateCommand.create({ + template: step.template.content as string, + data: this.getCompilePayload(command.compileContext), + }) + ); + } } catch (e) { await this.sendErrorHandlebars(command.job, e.message); diff --git a/apps/worker/src/app/workflow/usecases/send-message/send-message-in-app.usecase.ts b/apps/worker/src/app/workflow/usecases/send-message/send-message-in-app.usecase.ts index 557b708b073..49648cc3b7a 100644 --- a/apps/worker/src/app/workflow/usecases/send-message/send-message-in-app.usecase.ts +++ b/apps/worker/src/app/workflow/usecases/send-message/send-message-in-app.usecase.ts @@ -107,25 +107,27 @@ export class SendMessageInApp extends SendMessageBase { } try { - const compiled = await this.compileInAppTemplate.execute( - CompileInAppTemplateCommand.create({ - organizationId: command.organizationId, - environmentId: command.environmentId, - payload: this.getCompilePayload(command.compileContext), - content: step.template.content as string, - cta: step.template.cta, - userId: command.userId, - }), - this.initiateTranslations.bind(this) - ); - content = compiled.content; + if (!command.chimeraData) { + const compiled = await this.compileInAppTemplate.execute( + CompileInAppTemplateCommand.create({ + organizationId: command.organizationId, + environmentId: command.environmentId, + payload: this.getCompilePayload(command.compileContext), + content: step.template.content as string, + cta: step.template.cta, + userId: command.userId, + }), + this.initiateTranslations.bind(this) + ); + content = compiled.content; - if (step.template.cta?.data?.url) { - step.template.cta.data.url = compiled.url; - } + if (step.template.cta?.data?.url) { + step.template.cta.data.url = compiled.url; + } - if (step.template.cta?.action?.buttons) { - step.template.cta.action.buttons = compiled.ctaButtons; + if (step.template.cta?.action?.buttons) { + step.template.cta.action.buttons = compiled.ctaButtons; + } } } catch (e) { await this.sendErrorHandlebars(command.job, e.message); diff --git a/apps/worker/src/app/workflow/usecases/send-message/send-message-push.usecase.ts b/apps/worker/src/app/workflow/usecases/send-message/send-message-push.usecase.ts index 3d50da8706d..070901ad582 100644 --- a/apps/worker/src/app/workflow/usecases/send-message/send-message-push.usecase.ts +++ b/apps/worker/src/app/workflow/usecases/send-message/send-message-push.usecase.ts @@ -91,19 +91,21 @@ export class SendMessagePush extends SendMessageBase { let title = ''; try { - content = await this.compileTemplate.execute( - CompileTemplateCommand.create({ - template: step.template?.content as string, - data, - }) - ); + if (!command.chimeraData) { + content = await this.compileTemplate.execute( + CompileTemplateCommand.create({ + template: step.template?.content as string, + data, + }) + ); - title = await this.compileTemplate.execute( - CompileTemplateCommand.create({ - template: step.template?.title as string, - data, - }) - ); + title = await this.compileTemplate.execute( + CompileTemplateCommand.create({ + template: step.template?.title as string, + data, + }) + ); + } } catch (e) { await this.sendErrorHandlebars(command.job, e.message); diff --git a/apps/worker/src/app/workflow/usecases/send-message/send-message-sms.usecase.ts b/apps/worker/src/app/workflow/usecases/send-message/send-message-sms.usecase.ts index d26436ddc93..55cbabdd12f 100644 --- a/apps/worker/src/app/workflow/usecases/send-message/send-message-sms.usecase.ts +++ b/apps/worker/src/app/workflow/usecases/send-message/send-message-sms.usecase.ts @@ -89,12 +89,14 @@ export class SendMessageSms extends SendMessageBase { let content: string | null = ''; try { - content = await this.compileTemplate.execute( - CompileTemplateCommand.create({ - template: step.template.content as string, - data: this.getCompilePayload(command.compileContext), - }) - ); + if (!command.chimeraData) { + content = await this.compileTemplate.execute( + CompileTemplateCommand.create({ + template: step.template.content as string, + data: this.getCompilePayload(command.compileContext), + }) + ); + } } catch (e) { await this.sendErrorHandlebars(command.job, e.message);