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/webhookendpoint 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
- 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_whatsappmodule) - Publicly accessible Got2 instance — Meta must be able to reach your webhook URL over HTTPS
- SSL certificate — Webhook URL must use HTTPS (required by Meta)
Installation
- 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_discussfolder 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:
- Go to Settings > Integrations > Meta WhatsApp Cloud API
- Verify that Phone Number ID, Access Token, and Business Account ID are filled in
Step 2: Configure the Webhook
- Go to Settings > Integrations > Meta WhatsApp Cloud API
- Scroll to the Webhook Configuration section
- Click Generate to create a verify token (or enter your own)
- Copy the Webhook URL (e.g.,
https://your-domain.com/whatsapp/webhook) - Click Save
Step 3: Configure Webhook in Meta Developer Console
- Go to Meta Developer Console
- Open your WhatsApp Business app
- Navigate to WhatsApp > Configuration > Webhooks
- Click Edit and enter:
- Callback URL: Paste the Webhook URL from Got2
- Verify Token: Paste the verify token from Got2
- Click Verify and Save
- 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:
- Go to Settings > WhatsApp > Message Templates
- Create or fetch templates (see
got2_pos_whatsappmodule documentation) - Templates must be in Approved status to use in the template selector
Usage
Receiving WhatsApp Messages
- When a customer sends a WhatsApp message to your business number, a new Discuss channel is automatically created
- The channel is named "WA: [Customer Name]" and appears in your Discuss sidebar
- The message content (text, images, documents, etc.) appears as a normal Discuss message
- A matching contact is linked automatically (or created if not found)
Replying to WhatsApp Messages
- Open the WhatsApp Discuss channel
- Type your message in the Discuss composer as usual
- Click Send — the message is automatically sent via WhatsApp to the customer
- 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):
- Open the WhatsApp Discuss channel
- Click the green WhatsApp button (bottom-right corner)
- The Send WhatsApp Template wizard opens:
- Select an approved template from the dropdown
- Fill in variable values (
{{1}},{{2}}, etc.) - Preview the final message
- Click Send Template
- 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_discussmodule is installed and updated
Support
For issues, questions, or feature requests, please contact Got2 Software support.
License
This module is licensed under Other proprietary.