Skip to content

Connector for WhatsApp API from Odoo pipelines. Version 15.

Notifications You must be signed in to change notification settings

chatwithio/odoo-whatsapp-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

odoo-whatsapp-api

Odoo WhatsApp 360 Dialog Integration

Description

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.

Requirements

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

Installation

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.

dependencies_conf


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.

install_module

https://github.com/chatwithio/odoo-whatsapp-api/tree/main/static/description/install_module.jpeg

Configuration

To start sending messages, there are some issues to consider after installing the module:

Connection Settings

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

WhatsApp Image 2024-06-01 at 13 21 57

Other Settings

**SET WEBHOOK**: once you complete the webhook url you have to set that connection clicking the Menu `WhatsApp > Configuration > Set Webhook`

set_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:

model_adaptation

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:

message_template

https://github.com/chatwithio/odoo-whatsapp-api/tree/main/static/description/message_template.png


Usage

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.

send_message

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.

email_template

https://github.com/chatwithio/odoo-whatsapp-api/tree/main/static/description/email_template.png

Technical Support

Contact: info@chatwith.io

About

Connector for WhatsApp API from Odoo pipelines. Version 15.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages