feat(sms): add doctor appointment notification SMS for paid appointments
This commit is contained in:
@@ -321,6 +321,17 @@ final class PaymentManager
|
||||
]);
|
||||
$this->smsService->dispatchAsync($mobile, $message, tag: SmsLog::TAG_PAYMENT);
|
||||
}
|
||||
|
||||
// اعلان به شمارهٔ «اعلان نوبت» دکتر — فقط برای نوبتهای پرداختشدهٔ سایت (همین مسیر).
|
||||
$notify = $doctor->getNotificationMobile();
|
||||
if ($notify) {
|
||||
$docMessage = $this->smsText->resolve(SmsLog::TAG_DOCTOR_APPOINTMENT, [
|
||||
'patient' => $appointment->getPatientName() ?? '—',
|
||||
'date' => $this->jalali->formatDateTime($appointment->getSlotStart(), false),
|
||||
'time' => date('H:i', $appointment->getSlotStart()),
|
||||
]);
|
||||
$this->smsService->dispatchAsync($notify, $docMessage, tag: SmsLog::TAG_DOCTOR_APPOINTMENT);
|
||||
}
|
||||
}
|
||||
|
||||
private function handleSubscriptionActivation(Payment $payment): void
|
||||
|
||||
@@ -20,6 +20,7 @@ class SmsLog
|
||||
public const TAG_USER_TEMPLATE = 'user_template';
|
||||
public const TAG_WELCOME = 'welcome';
|
||||
public const TAG_SECRETARY = 'secretary';
|
||||
public const TAG_DOCTOR_APPOINTMENT = 'doctor_appointment';
|
||||
|
||||
public const TAGS = [
|
||||
self::TAG_GLOBAL,
|
||||
@@ -31,6 +32,7 @@ class SmsLog
|
||||
self::TAG_USER_TEMPLATE,
|
||||
self::TAG_WELCOME,
|
||||
self::TAG_SECRETARY,
|
||||
self::TAG_DOCTOR_APPOINTMENT,
|
||||
];
|
||||
|
||||
#[ORM\Id]
|
||||
|
||||
@@ -48,6 +48,11 @@ class SmsMessageTemplate
|
||||
'body' => "شما بهعنوان منشیِ {owner} در کلینیکپرو تعریف شدید.\nشمارهکاربری: {username}\nلینک ورود: {link}",
|
||||
'variables' => ['owner', 'username', 'link'],
|
||||
],
|
||||
SmsLog::TAG_DOCTOR_APPOINTMENT => [
|
||||
'title' => 'نوبت جدید (اعلان به پزشک)',
|
||||
'body' => "نوبت جدید ثبت شد.\nبیمار: {patient}\nتاریخ: {date} ساعت {time}\n\nبرای مدیریت نوبتهای خود بهصورت رایگان به سایت clinic-pro.ir مراجعه کنید.\nکلینیک پرو",
|
||||
'variables' => ['patient', 'date', 'time'],
|
||||
],
|
||||
];
|
||||
|
||||
#[ORM\Id]
|
||||
|
||||
Reference in New Issue
Block a user