Odoo WhatsApp 360 Dialog Integration
This module allows to send messages in any Odoo model. The messages can be from pre-loaded templates of the 360 Dialog namespace or manually writen if the conversation has already been started. If the message fails, and activity will be created in order to correct the issue.This module was tested in v15, v16 and v17. To use this module you need to have an authorized API key. You can request one here.
For development purposes there is a Sandbox environment, in which you can get a free API key to send unlimited WhatsApp Messages to your own phone Number.
This module allows to send messages using the development environment. Check out the sandbox docs to get you free API key
1. Download or clone the repository and put it in any folder of your Odoo addons path.
2. Configure module dependencies. This module allows to send messages in any model of Odoo. That means you can send WhatsApp messages in your leads, opportunities, purchases, sales, invoices or any other document you are managing. By default the WhatsApp messages are set only in the CRM module. You can change this in the `__manifest__.py` file located in the main directory.
3. Install the module. Start your Odoo server, go to the Apps menú and search for the module. Note: clean the search bar default filters. If the module does not appear, you can try clicking the "Update Apps List" located in the upper menu bar (with the odoo developer mode activated) or review in the odoo.conf the addons path.
https://github.com/chatwithio/odoo-whatsapp-api/tree/main/static/description/install_module.jpeg
To start sending messages, there are some issues to consider after installing the module:Go to the Settings menu, select the WhatsApp section and fill the configuration settings.
API KEY: add in the general config settings the company API-KEY. For Sandbox Api keys activate the Developer Mode.
NAMESPACE: add in the general config settings the company namespace. For developer environment use c8ae5f90_307a_ca4c_b8f6_d1e2a2573574
.
WEBHOOK ADDRESS : the module needs the webhook connection to work properly. Every API key has its own unique WebHook configuration, so make sure it is not used for other developments. Complete the server url considering this example https://your-odoo-domain.com
.
The module sets the webhook url with the configured url followed by /api/v1/whatsapp/webhook
For developer environment you can use free API development tools like POSTMAN requesting http://localhost:8069/api/v1/whatsapp/webhook
**MODEL ADAPTATION**: this module allows to send whatsapp messages for any model that is subscribed to the mail and activity native features. For each model you have to add a configuration going to the menu `WhatsApp > Configuration > Model Adaptation`
In order to send messages for a particular model, a model adaptation configuration needs to be added. For each model, you have to define:
→ Message Error Activity Configuration: who is going to receive the activity notification when a message has failed. You can add a specific user or any user field of the model. If both fields are set, the Default User is taken into account only if the User field is not set.
→ Phone Number Fields: define from witch fields contains the phone number information. You can select `res.partner` fields. If multiple fields are set, the `res.partner` fields have priority, looking first in the partner's `mobile` and if it's not set in `phone`
By default the module has preloaded an example of configuration for `crm.lead` model:
https://github.com/chatwithio/odoo-whatsapp-api/tree/main/static/description/model_adaptation.png
**MESSAGE TEMPLATES**: the 360 Dialog Templates of your Namespace can be managed in the menu `WhatsApp > Configuration > Message Templates`. Make sure to set up properly the 360 Dialog Reference and the language.
For templates that uses params, you have to configure the content of them. Each param variable is going to be replaced in the content in the '[]' space.
The variable params can be either custom plain text or filled with any model field (only char and many2one fields).
For developer purposes check out the Sandbox available templates.
Here is an example of the `first_welcome_messsage` template:
https://github.com/chatwithio/odoo-whatsapp-api/tree/main/static/description/message_template.png
This module modifies two native Odoo features:
→ **Mail Compose Wizard**: every odoo model subscribed to the `mail` features, can send an email with the mail compose wizard. In this form you can find an WhatsApp Checkbox to change the functionality to send a WhatsApp Message instead an email.
https://github.com/chatwithio/odoo-whatsapp-api/tree/main/static/description/send_message.png
→ **Message Post With Template**: massive emailing can use this method to send a predefine template. The mail templates have a configuration that links that template with a 360 Dialog Template. When a message is post with a Mail Template related to a WhatsApp template the mail is replaced with a WhatsApp message. This is used by the Mail Automation module.
https://github.com/chatwithio/odoo-whatsapp-api/tree/main/static/description/email_template.png
Contact: info@chatwith.io