WhatsApp

With the WhatsApp feature, you talk to your customers on WhatsApp from Odoo, through the official WhatsApp Business Cloud API of Meta. You can send message templates from contacts, quotations, sales orders, invoices, and CRM leads, receive the answers in Discuss, and follow the delivery of each message (sent, delivered, read, failed).

Important

This feature is not installed automatically. Install WhatsApp (Meta Cloud API) from Apps. It needs a WhatsApp Business Account at Meta, a phone number registered in it, and the Meta webhooks.

Connect a WhatsApp Business Account

Go to Meta ‣ WhatsApp ‣ Accounts (administrators only), and click New:

Field

Description

Name

For example Customer Service.

WhatsApp Business Account group

The WhatsApp Business Account ID and the Phone Number ID, shown in the WhatsApp Manager of Meta. The display phone number, the verified name, and the quality rating are filled in by Odoo.

Authentication

System user access token: paste the permanent token of a system user of your business. Or Meta connection: use a Meta connection.

Responsible Users

The users who receive the incoming conversations.

Then use the buttons:

  1. Load Phone Numbers: reads the phone numbers of the account. The Phone Numbers tab lists them; click Use on the one that this account uses.

  2. Subscribe App to WABA: makes your Meta app receive the notifications of the account. In the webhooks of the Meta app, subscribe the WhatsApp Business Account object to the messages and message_template_status_update fields (see Webhooks).

  3. Sync Templates: downloads the message templates.

screenshot: meta-whatsapp-account
menu
Meta ‣ WhatsApp ‣ Accounts ‣ (an account)
shows
A WhatsApp account form with the Load Phone Numbers, Sync Templates, and Subscribe App to WABA buttons, the WhatsApp Business Account group (WABA ID, phone number ID, display number, verified name, quality rating), the Access group (authentication, token hidden), and the Responsible Users tab.
highlight
The three header buttons (red frame).
data
Throw-away account, token hidden.
notes
English UI, light theme, 1440px width.

Templates

WhatsApp only allows to start a conversation with a template that Meta approved. Create and submit your templates in the WhatsApp Manager of Meta. In Odoo, Meta ‣ WhatsApp ‣ Templates lists the templates downloaded with Sync Templates, with their language, category (Marketing, Utility, Authentication), and status (Approved, Pending, Rejected, Paused, and so on). The status is updated automatically when Meta changes it.

Open a template to configure it:

  • Model: the type of document whose fields fill the variables (for example the quotation). The Send WhatsApp action is added to this document.

  • In the Variables tab, for each variable of the template ({{1}}, or a name), choose the source: a Document field (for example the name of the customer or the reference of the order) or a Fixed text.

  • The Preview tab shows the message with the values of the variables, and the Content tab the texts of the template (they can only be changed in Meta).

screenshot: meta-whatsapp-template
menu
Meta ‣ WhatsApp ‣ Templates ‣ (a template)
shows
A WhatsApp template form with its status bar, the language and category, the document model, and the Variables tab where each variable is mapped to a document field.
highlight
The Variables tab (red frame).
data
Template "order_confirmation" with the variables customer name and order reference.
notes
English UI, light theme, 1440px width.

Click Add “Send WhatsApp” to Documents in Meta ‣ Configuration ‣ Settings (WhatsApp Accounts setting) to add the action to the contacts, quotations and sales orders, invoices, and leads.

Send a message

On a contact, a quotation, a sales order, an invoice, or a lead, open the Action menu and click Send WhatsApp:

  1. Select the Account and check the Phone of the customer and its Country. Odoo formats the number in the international format.

  2. Choose the Mode:

    • Template: select an approved template. The variables are filled in from the document; you can edit them. A template message can be sent at any time.

    • Free text: write your message, and attach files if needed. It is only possible while the customer service window is open: it opens when the customer writes to you, and closes 24 hours after the last message of the customer.

  3. Check the preview and click Send.

A copy of the message is logged in the chatter of the document. The status of the message (sent, delivered, read, or failed with the error) is updated, and the list of the messages is in Meta ‣ WhatsApp ‣ Messages.

Warning

A contact who asked not to receive marketing messages (see Opt-out keywords) does not receive templates of the Marketing category. Meta also bills each conversation according to its category: check the prices in your Meta account.

Conversations

When a customer answers (text, images, documents, audio, video, locations, button and list replies), the message arrives in a Discuss conversation of the customer’s phone number, and the sender is found by phone number or created as a contact. The conversations are listed in Meta ‣ WhatsApp ‣ Conversations; the contact form has an Open in Discuss button.

Answer from the conversation: your message is sent on WhatsApp while the customer service window is open. When the window is closed, use Send WhatsApp with a template to restart the conversation.

Opt-out keywords

In the Meta settings, enable the opt-out keywords to respect the customers who do not want marketing messages. When a customer sends one of the Opt-out Keywords (STOP by default, comma separated, not case sensitive; the whole message must be the keyword), the contact is flagged WhatsApp Opt-out and no longer receives the marketing templates. The Opt-in Keywords (START by default) remove the flag. You can also change the flag manually on the contact.

Files that the customers send are downloaded only up to the Maximum Media Size (MB) of the Received Files setting (16 MB by default).

Test WhatsApp

  1. Use the test number of your Meta app, or a real number, and add your own phone as a recipient in the WhatsApp Manager.

  2. Click Send WhatsApp on a contact that has your phone number, choose a template, and send.

  3. The message must arrive on your phone, and its status must become Delivered in Meta ‣ WhatsApp ‣ Messages.

  4. Answer from your phone: the message must appear in the Discuss conversation. If it does not, check the Meta ‣ Webhook Notifications list and Webhook troubleshooting.

  5. A message in the status Failed shows the error of Meta: a template that is not approved, a closed customer service window, a phone number that is not on WhatsApp, or an expired token.