How to use OTP Template message in WhatsApp

How to use OTP Template message in WhatsApp

This guide explains how to set up OTP Authentication using WhatsApp message templates in OCP. Follow the detailed steps below, with visuals included, to successfully implement OTP Authentication.

1. Creating the WhatsApp Message Template

  • Navigate to Content > Message Template.

  • Click on New Template.



  • Template Details:

    • Name: Enter a name for your template, e.g., "OTP Login".

    • Category: Select Authentication.

  • Message Content:

    • Customize the message, e.g., "Your verification code is {{1}}. For your security, do not share this code.".

    • Optional fields:

      • Add a Security Disclaimer (recommended).

      • Mention the Code Expiry Duration, e.g., "This code will expire in 3 minutes."

  • Preview your message to ensure it meets your requirements.

  • Submit the template for approval. Once approved, it will be ready for use.



2. Setting Up the Flow to Use the Message Template

  • Create a new flow or edit an existing one.

  • Add a Send Message block.

    • Select Message Template under the "Other" category.



  • Choose your OTP message template from the list.



  • Insert Variables:

    • Add the dynamic custom field for the OTP code, e.g., {{OTP_Code}}.



3. Generating the OTP Code

  • Before sending the message, generate a unique OTP code:

    1. Add an Action Block to the flow.



  1. Select Set Variable Value.



  1. Configuration:

    • Set the Variable Name to OTP_Code.

    • Under Operation, choose Generate Random Text.

    • Use the format #### for a 4-digit code.



  • Save the action node setup.


4. Prompting the User to Enter the OTP

  • Add a Question Block to ask the user for the OTP:

    • Message: "We've sent you a code on WhatsApp. Please copy and paste it here."

    • Save the user’s input to a custom field, e.g., Response.



5. Validating the OTP

  • Add a Condition Block to compare the OTP:

    • Condition: Check if OTP_Code (generated) matches Response (user input).



  • Outcomes:

    • If Yes: Proceed to the next step, e.g., "User Verified."

    • If No: Display an error message, e.g., "Invalid Code. Please try again.".

  1. Retry Mechanism

  • Allow users to retry if the OTP is incorrect:

    • Add a Button Block with options to restart the OTP flow.

Key Notes:

  • Ensure the WhatsApp template is approved before use.

  • Customize messages and variables to suit your brand's tone.

  • Test the flow thoroughly before deployment.



    • Related Articles

    • Message Template Guidelines

      Templates Templates are used in template messages to open marketing, utility, and authentication conversations with customers. Unlike free-form messages, template messages are the only type of message that can be sent to customers who have yet to ...
    • WhatsApp Authenticate Template Message

      WhatsApp’s new message template feature is a game-changer for creating limited-time offers! We will guide you through creating effective discount campaigns designed to engage users even beyond the standard 24-hour window. Let’s explore the steps to ...
    • How to use Template message

      Use in the flow builder Template messages offer more features, like the buttons(which can link to external URLs) & phone call button. You can send the template message right in the flow builder. It’s free to send if it’s within a 24-hour engagement ...
    • Titles for WhatsApp Message Templates

      OCP has introduced a new feature that allows administrators to assign titles to WhatsApp Message Templates. This enhancement improves usability by allowing Live Chat agents to easily identify and select templates based on assigned titles. ...
    • WhatsApp Cloud API

      Prerequisites Video Instructions Step by Step Instructions Step 1: Sign in with Facebook Step 2: Create or select a Meta Business Manager account Step 3: Create WhatsApp Business Profile Step 4: Verify WhatsApp Business Number Step 5: Complete ...