(20250227) prepending 0 to kenyan phone nos.

This commit is contained in:
2025-02-27 13:02:34 +05:30
parent cab0e19ede
commit 07800bd403
+10 -1
View File
@@ -230,8 +230,17 @@ async def generate_otp(
)
# Format the message:
phone_no = regex.replace(
text = inbound_data.recipientNo,
pattern = r"[^\d]",
substitute_text = ""
)
if (
not phone_no.startswith("0") and
not phone_no.startswith("254")
): phone_no = "0" + phone_no
sms_message = SavvyBulkSMSKenyaMessage(
recipientNo = inbound_data.recipientNo,
recipientNo = phone_no,
text = inbound_data.smsText.replace(inbound_data.smsReplace, str(otp_response.data))
)