All Products
Search
Document Center

Chat App Message Service:Send OTP messages to global users

Last Updated:Feb 04, 2026

This tutorial shows how to use Chat Flow to send one-time password (OTP) messages to global users.

Background

With over 2 billion active users across nearly 200 countries and regions, WhatsApp is a vital channel for businesses to send OTPs, notifications, and marketing campaigns. Because accounts are tied directly to phone numbers, WhatsApp offers an effective way to reach users.

However, a WhatsApp-only strategy is often insufficient for reliable global OTP delivery for two reasons:

  • Time sensitivity: OTPs are used for authentication and typically expire within a minute. They demand immediate and reliable delivery, which is difficult to guarantee on any single channel.

  • Inconsistent global penetration: WhatsApp's popularity varies by country. In regions where other messaging apps are preferred, the OTP delivery rate on WhatsApp drops significantly.

Therefore, businesses need a multi-channel strategy. But this introduces new challenges: how do you identify which channel to use for a given phone number? How do you manage sending messages across multiple channels?

Solution

Use Chat Flow to intelligently route messages across channels.

Chat App Message Service is a powerful messaging engine that helps businesses reach users. It unifies major global messaging channels, including WhatsApp, Viber, Messenger, and Instagram.

At the heart of this service is Chat Flow, an intuitive, low-code visual editor. Using a simple drag-and-drop interface, any member of your team can build sophisticated communication workflows on a large canvas. You can select from and configure multiple pre-built components for messaging, flow control, AI capabilities, and marketing automation.

The visual canvas includes a vast toolkit organized into four categories: channel dock, flow dock, AI dock, and marketing dock. For more information about Chat Flow, refer to Chat Flow.

Flow Editor (Chat Flow) canvas with various components

Procedure

Scenario: Your user base spans multiple countries. You decide to use Viber to reach users in the Philippines, WhatsApp for Malaysia, and SMS for all other countries.

Flow diagram:

Flow diagram showing a multi-channel OTP delivery process

The process involves five main steps:

  1. Set variables

    In the Chat App Message Service console, navigate to Chat Flow > Flow Management. Click the name of a flow whose Trigger Type is Manual. On the canvas, click the Start node, then disable Do Not Accept Incoming Variables in the right-side pane. For this scenario, define two variables: customerPhoneNumber and verificationCode.

    Start node configuration with input variables

  2. Create country-based branches

    From the component library, drag the Recognize a Phone Number component to the canvas. Set the input variable to customerPhoneNumber.

    In the right-side pane, turn on Multi-branching. To branch based on country/region code, select Region Code. From the drop-down list, select the international codes for your target countries (PH and ML in this example).

    Assign an Output Variable Name. Subsequent components can reference this variable.

    Identify Phone Number component with branches for PH and ML

  3. Configure the else branch

    Drag the Send an SMS Message component to the else branch. In the right-side pane, set a Sender ID. For the recipient's phone number, select the customerPhoneNumber variable defined in the Start node. In the Message Content section, set Content Type to Verification Code and enter the message text. For example:

    "Your one-time password is: {{verificationCode}}. The password is valid for 10 minutes. Please do not tell anyone the password to avoid losses."

    Here, verificationCode is the variable defined in the Start node. To add variables in the text, enter {{ and select from the list of all available variables.

    Send SMS component configuration

    Note

    It is a best practice to configure the fallback channel first. This else branch handles all numbers that do not match the specific country branches.

  4. Configure the PH branch

    Drag the Send a Viber Message component to the PH branch.

    • In the Message Sending Settings section, set Action to From/To and Message Type to Transaction. Select Service ID for the Sending Type parameter and select a Viber channel. In the Recipient field, enter {{ to specify the customerPhoneNumber variable defined in the Start node.

    • In the Message Settings section, set Message Type to Text, and enter the message body. For example:

      "Your one-time password is: {{verificationCode}}. The password is valid for 10 minutes. Please do not tell anyone the password to avoid losses."
      Note

      Here, verificationCode is the variable defined in the Start node.

      Send Viber Message component configuration

    • In the Timeout Settings section, you can set a timeout to trigger an action if the message is not delivered or read within a specified time.

      Timeout settings for the Viber component

      In this example, if the message is not delivered within 30 seconds, a WhatsApp message is sent. If the message is not read within 60 seconds, an SMS is sent. The following steps describe how to configure this.

      Send a WhatsApp message if not delivered in 30 seconds

      1. Drag the Send a WhatsApp Message component to the undelivered branch.

      2. Click the Send a WhatsApp Message component. In the Message Sending Settings section, set Action to From/To and Sending Type to Mobile Number. Select a WhatsApp channel and a verified WhatsApp number. In the Recipient field, enter {{ to specify the customerPhoneNumber variable defined in the Start node.

      3. In the Message Settings section, set Message Type to Template Message, select the channel specified in the Message Sending Settings section, and then select a template. Templates must be created in advance and approved by WhatsApp.

        Send WhatsApp Message component configuration

      Send an SMS if not read in 60 seconds

      1. Drag the Jump to Another Step component to the unread branch.

      2. Click the Jump to Another Step component. In the Basic Configuration section, set the Jump to parameter to Send an SMS Message. Configure the Maximum number of jumps. This setting prevents infinite loops. For example, if you enter 3, the jump will not occur on the fourth attempt.

        Go to Node component configuration

      You can also configure the undelivered and unread branches for this Send a WhatsApp Message component. In this example, if the WhatsApp message is not delivered within 30 seconds, the flow jumps to the else branch to send an SMS message. You can add a Jump to Another Step component and specify the name of the component to which you want to jump. The component name is customizable.

    Note

    When sending an OTP message to a user in the Philippines, the system first sends it through Viber. If the Viber message fails, it tries WhatsApp next. If that also fails, it falls back to SMS. This multi-channel fallback strategy maximizes the chance of delivery.

  5. Configure the ML branch

    In the ML branch, configure the flow for Malaysian numbers. The configuration is similar to that of the PH branch. For phone numbers in Malaysia, the flow first prioritizes WhatsApp. If the WhatsApp message fails, it tries Viber. If the Viber message also fails, the flow jumps to the SMS channel in the else branch. If the initial WhatsApp message is delivered and read, the flow ends.