templete campain

This commit is contained in:
2026-07-11 22:08:41 +03:30
parent bf4e4c8d65
commit b1da7fdeac
19 changed files with 867 additions and 37 deletions
+12
View File
@@ -63,6 +63,18 @@ export class SmsDispatchService {
return renderSmsTemplate(body, variables);
}
async resolveMessageFromTemplateId(
templateId: string,
variables: Record<string, string>,
): Promise<string | null> {
const template = await this.smsTemplatesService.findOne(templateId);
if (!template.isActive) {
return null;
}
return renderSmsTemplate(template.body, variables);
}
async previewMessage(dto: PreviewSmsScenarioDto): Promise<string> {
const body = await this.resolvePreviewBody(dto);
const variables = getSampleVariables(dto.key);