Substitute org name and balance tokens in outbound SMS so templates no longer leave {از طرف} literal.
EOF Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1572,11 +1572,16 @@ export class LeadsService {
|
||||
const mobile = lead.mobile || lead.phone;
|
||||
if (!mobile) throw new BadRequestException('برای این لید شماره موبایل ثبت نشده است.');
|
||||
const name = (lead.contactName || lead.title).trim();
|
||||
const org = await this.prisma.organization.findUnique({
|
||||
where: { id: actor.organizationId },
|
||||
select: { name: true },
|
||||
});
|
||||
const message = renderSmsText(body, {
|
||||
name,
|
||||
phone: mobile,
|
||||
title: lead.title,
|
||||
company: lead.contactName ? lead.title : '',
|
||||
company: lead.trade?.trim() || '',
|
||||
from: org?.name?.trim() || '',
|
||||
});
|
||||
if (!message) throw new BadRequestException('متن پیامک خالی است.');
|
||||
const result = await this.sms.send({
|
||||
|
||||
Reference in New Issue
Block a user