WhatsApp in Discuss

This module integrates WhatsApp messaging into Got2's Discuss module using the official Meta WhatsApp Cloud API. It enables bi-directional chat — send and receive WhatsApp messages directly from Discuss channels.


Features

💬 Bi-Directional WhatsApp Chat in Discuss

  • Incoming messages appear in Discuss — when a customer sends a WhatsApp message, it automatically creates a Discuss channel and posts the message there
  • Outgoing messages sent via WhatsApp — when an agent types a message in a WhatsApp Discuss channel, it is automatically sent to the customer via WhatsApp
  • Real-time conversation flow — agents chat in Discuss as they normally would; messages are routed through WhatsApp transparently

📎 Media Support

  • Receive images, videos, audio, and documents — media files sent by customers are downloaded and attached to the Discuss message
  • Send attachments — files attached to Discuss messages are uploaded to Meta and sent via WhatsApp
  • Location and contact sharing — incoming location pins and shared contacts are displayed as formatted text

📋 WhatsApp Template Selector

  • Send template messages from Discuss — use the WhatsApp button to open a template selector wizard
  • Browse approved templates — only Meta-approved templates are shown in the dropdown
  • Fill template variables — enter values for {{1}} , {{2}} , etc. with a live preview
  • Template preview — see the final message before sending
  • Initiate conversations — use templates to start new conversations with customers (required by Meta for business-initiated messages outside the 24-hour window)
  • Access from chat list — "Send Template" button available on the WhatsApp Chat form view

🔔 Message Status Tracking

  • Delivery tracking — sent, delivered, and read status updates from Meta are tracked on each message
  • 24-hour session window — visual indicator showing whether the customer's session is active (replied within 24 hours) or expired

📊 WhatsApp Chat Management

  • Chat list view — see all WhatsApp conversations with status, last message date, and message count
  • Contact auto-linking — incoming messages are automatically matched to existing contacts by phone number
  • Auto-create contacts — if no matching contact is found, a new one is created automatically
  • Open in Discuss — one-click navigation from the chat list to the Discuss channel

🔗 Webhook Integration

  • Automatic webhook endpoint/whatsapp/webhook  endpoint for Meta to send incoming messages
  • Webhook verification — handles Meta's GET verification challenge automatically
  • Configurable verify token — generate and manage the verify token from Settings
  • Copyable webhook URL — webhook URL is displayed in Settings for easy copy-paste into Meta Console

Prerequisites

  1. Meta WhatsApp Cloud API configured — Phone Number ID, Access Token, and Business Account ID must be set up in Settings > Integrations > Meta WhatsApp Cloud API (provided by the got2_pos_whatsapp  module)
  2. Publicly accessible Got2 instance — Meta must be able to reach your webhook URL over HTTPS
  3. SSL certificate — Webhook URL must use HTTPS (required by Meta)

Installation

  1. Dependencies: Ensure the following modules are installed:
    • mail  (Got2 core Discuss)
    • contacts  (Got2 core)
    • got2_system_base  (Integrations settings page)
    • got2_pos_whatsapp  (Meta WhatsApp API credentials + template management)

      Install the module:

    • Place the got2_wa_discuss  folder in your addons directory
    • Update the module list in Got2
    • Search for "WhatsApp in Discuss" and click Install

Configuration

Step 1: Ensure Meta WhatsApp API is Configured

The API credentials are shared with the got2_pos_whatsapp  module:

  1. Go to Settings > Integrations > Meta WhatsApp Cloud API
  2. Verify that Phone Number ID, Access Token, and Business Account ID are filled in

Step 2: Configure the Webhook

  1. Go to Settings > Integrations > Meta WhatsApp Cloud API
  2. Scroll to the Webhook Configuration section
  3. Click Generate to create a verify token (or enter your own)
  4. Copy the Webhook URL (e.g., https://your-domain.com/whatsapp/webhook )
  5. Click Save

Step 3: Configure Webhook in Meta Developer Console

  1. Go to Meta Developer Console
  2. Open your WhatsApp Business app
  3. Navigate to WhatsApp > Configuration > Webhooks
  4. Click Edit and enter:
    • Callback URL: Paste the Webhook URL from Got2
    • Verify Token: Paste the verify token from Got2
  5. Click Verify and Save
  6. Subscribe to these webhook fields:
    • messages — to receive incoming messages
    • message_template_status_update — to track template approval changes

Step 4: Create Message Templates (Optional)

To initiate conversations with customers (outside the 24-hour reply window), you need approved templates:

  1. Go to Settings > WhatsApp > Message Templates
  2. Create or fetch templates (see got2_pos_whatsapp  module documentation)
  3. Templates must be in Approved status to use in the template selector

Usage

Receiving WhatsApp Messages

  1. When a customer sends a WhatsApp message to your business number, a new Discuss channel is automatically created
  2. The channel is named "WA: [Customer Name]" and appears in your Discuss sidebar
  3. The message content (text, images, documents, etc.) appears as a normal Discuss message
  4. A matching contact is linked automatically (or created if not found)

Replying to WhatsApp Messages

  1. Open the WhatsApp Discuss channel
  2. Type your message in the Discuss composer as usual
  3. Click Send — the message is automatically sent via WhatsApp to the customer
  4. Attachments (images, PDFs, etc.) are also sent as WhatsApp media messages

Sending Template Messages

When the 24-hour conversation window has expired (or to initiate a new conversation):


  1. Open the WhatsApp Discuss channel
  2. Click the green WhatsApp button (bottom-right corner)
  3. The Send WhatsApp Template wizard opens:
    • Select an approved template from the dropdown
    • Fill in variable values ({{1}} , {{2}} , etc.)
    • Preview the final message
  4. Click Send Template
  5. The template message is sent and a record is posted in the Discuss channel

Alternative: Go to Settings > WhatsApp > WhatsApp Chats, open a chat, and click Send Template in the header.


Managing WhatsApp Chats

Access all WhatsApp conversations at Settings > WhatsApp > WhatsApp Chats:


  • View all chats with their status (Active/Expired), last message date, and message count
  • Active = customer replied within the last 24 hours (free-form messages allowed)
  • Expired = no reply in 24 hours (must use templates to re-initiate)
  • Click Open in Discuss to jump directly to the conversation

Troubleshooting

Messages Not Being Received

  • Verify the webhook is configured correctly in the Meta Developer Console
  • Ensure the Webhook URL is publicly accessible over HTTPS
  • Check that the Verify Token matches between Got2 and Meta
  • Verify you subscribed to the "messages" webhook field
  • Check your Got2 server logs for webhook errors

"WhatsApp API error" When Sending Messages

  • Verify API credentials in Settings > Integrations > Meta WhatsApp Cloud API
  • Check that your access token has not expired
  • For first-time messages to a contact, use a template (free-form messages require a 24-hour session)

Template Selector Shows "No Templates"

  • Ensure templates are synced from Meta (Settings > WhatsApp > Message Templates > Action > Fetch from Meta)
  • Only Approved templates appear in the selector
  • Check that templates exist and have been approved in your Meta WhatsApp Manager

Media Files Not Downloading

  • Verify the access token has permission to download media
  • Check server logs for download errors
  • Ensure the Got2 server can reach graph.facebook.com

Discuss Channel Not Created for Incoming Messages

  • Check Got2 server logs for webhook processing errors
  • Verify the webhook endpoint returns HTTP 200 to Meta
  • Ensure the got2_wa_discuss  module is installed and updated

Support

For issues, questions, or feature requests, please contact Got2 Software support.


License

This module is licensed under Other proprietary.

Still need help? Contact Us Contact Us