OTP send
This commit is contained in:
parent
e98036cd31
commit
614cf1e7f5
4 changed files with 398 additions and 15 deletions
|
|
@ -74,6 +74,35 @@ def render_templates_for_project(message_label: str) -> list[dict]:
|
|||
return rendered
|
||||
|
||||
|
||||
# DLT-approved SMS body for Ultronsms (template ID 1777178797989033323).
|
||||
# All UrmiOTP template_type values are delivered using this registered text.
|
||||
URMI_OTP_SMS_CONFIG = {
|
||||
"sender_id": "URMIAI",
|
||||
"pe_id": "1701178780498045011",
|
||||
"dlt_template_id": "1777178797989033323",
|
||||
"message_template": (
|
||||
"Your URMI app verification code is {otp} for {message_label}. "
|
||||
"It is valid for {validity_minutes} minutes. "
|
||||
"Do not share it to anyone - URMI AI"
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def build_dlt_otp_message(variables: dict[str, str], message_label: str) -> str:
|
||||
otp_value = variables.get("otp", "").strip()
|
||||
validity = variables.get("validity_minutes", "").strip()
|
||||
label = message_label.strip()
|
||||
if not otp_value or not validity:
|
||||
raise ValueError("variables.otp and variables.validity_minutes are required")
|
||||
if not label:
|
||||
raise ValueError("message_label is required")
|
||||
return URMI_OTP_SMS_CONFIG["message_template"].format(
|
||||
otp=otp_value,
|
||||
message_label=label,
|
||||
validity_minutes=validity,
|
||||
)
|
||||
|
||||
|
||||
OTP_API_DOCUMENTATION = {
|
||||
"method": "POST",
|
||||
"path": "/api/v1/otp/generate",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue