Skip to content

Send Auth Messages by Bot Message Type #298

@dappsar

Description

@dappsar

Description

OTP codes are currently sent from the frontend flow. To improve deliverability and align with Meta policy, OTP messages must be sent as “Authentication” templates (not marketing), and must support Spanish/Portuguese/English with English fallback.

Scope

  • Update the OTP sending flow to include message type = Authentication and language.
  • Keep existing flow operational while the bot rollout happens.

Acceptance Criteria

  • OTP messages are sent as Authentication messages with correct language handling.
  • No regression in login flow.

Technical Detail

Update OTP bot call

In the frontend Next.js API route and/or the chatizalo service call:

  • Include message_kind: "auth"
  • Include preferred_language: "es|pt|en" with fallback
  • Provide a stable template_key: "otp_login"
  • Provide template_vars: { "code": "123456" }

Do not hardcode Meta template name in frontend.
The bot must resolve the template via DB.

Language source:

  • Use current i18n/locale selected by the user or accept a language field in the request body.
  • Normalize to es|pt|en, fallback en.

Related

Blocked By: https://github.com/P4-Games/ChatBot-WhatsappOpenIA/issues/232

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions