fix(automations): replace %نام_کوچک before generic %نام in SMS templates
The name placeholder regex was matching the prefix of %نام_کوچک first, leaving _کوچک in the rendered message. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -142,8 +142,9 @@ class AutomationSender
|
||||
]);
|
||||
|
||||
// الگوی پیامک/تنظیمات: %نام ، ٪نام ، % name ، %name%
|
||||
$out = preg_replace('/[%٪]\s*(?:name|نام)[%٪]?/iu', $name, $out) ?? $out;
|
||||
// نام_کوچک قبل از نام — وگرنه %نام داخل %نام_کوچک زودتر match میشود
|
||||
$out = preg_replace('/[%٪]\s*(?:fname|نام_کوچک|نامکوچک)[%٪]?/iu', $fname, $out) ?? $out;
|
||||
$out = preg_replace('/[%٪]\s*(?:name|نام)(?![_]?کوچک)[%٪]?/iu', $name, $out) ?? $out;
|
||||
$out = preg_replace('/[%٪]\s*(?:mobile|موبایل)[%٪]?/iu', $mobile, $out) ?? $out;
|
||||
|
||||
return $out;
|
||||
|
||||
Reference in New Issue
Block a user