Spaces:
Sleeping
Sleeping
Commit ·
e47349e
1
Parent(s): 84651f3
notification
Browse files
app/utils/notification_queue.py
CHANGED
|
@@ -164,10 +164,14 @@ class NotificationQueue:
|
|
| 164 |
new_password: str,
|
| 165 |
merchant_id: str = "",
|
| 166 |
merchant_name: str = "",
|
| 167 |
-
template_name: str = "
|
| 168 |
channels: Optional[List[str]] = None,
|
| 169 |
) -> bool:
|
| 170 |
-
"""Queue password reset notification via WhatsApp + SMS.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 171 |
if channels is None:
|
| 172 |
channels = ["whatsapp", "sms"]
|
| 173 |
|
|
@@ -176,8 +180,8 @@ class NotificationQueue:
|
|
| 176 |
channels=channels,
|
| 177 |
template_name=template_name,
|
| 178 |
template_data={
|
| 179 |
-
"
|
| 180 |
-
"
|
| 181 |
"merchant_name": merchant_name,
|
| 182 |
},
|
| 183 |
merchant_id=merchant_id,
|
|
|
|
| 164 |
new_password: str,
|
| 165 |
merchant_id: str = "",
|
| 166 |
merchant_name: str = "",
|
| 167 |
+
template_name: str = "otp_verification",
|
| 168 |
channels: Optional[List[str]] = None,
|
| 169 |
) -> bool:
|
| 170 |
+
"""Queue password reset notification via WhatsApp + SMS.
|
| 171 |
+
|
| 172 |
+
Uses the otp_verification template (already configured in WATI) with
|
| 173 |
+
new_password mapped to the 'otp' parameter so it delivers reliably.
|
| 174 |
+
"""
|
| 175 |
if channels is None:
|
| 176 |
channels = ["whatsapp", "sms"]
|
| 177 |
|
|
|
|
| 180 |
channels=channels,
|
| 181 |
template_name=template_name,
|
| 182 |
template_data={
|
| 183 |
+
"otp": new_password,
|
| 184 |
+
"expiry_minutes": "0", # not applicable for password reset
|
| 185 |
"merchant_name": merchant_name,
|
| 186 |
},
|
| 187 |
merchant_id=merchant_id,
|