Licence: OPL-1 · Revision: bb6d0d3174d7
SMS Gateway & API Routing | Odoo 16.0
Revolutionize Your Odoo SMS Communication
to see version history, click here
Welcome to the SMS Gateway module for Odoo 17—an innovative, cost-effective solution designed to revolutionize how you send SMS messages within Odoo! This module seamlessly integrates with Odoo’s built-in SMS functionalities, empowering you to leverage custom SMS APIs instead of relying solely on Odoo’s default IAP (Internet Application Provider) service, which can be prohibitively expensive, especially for users outside the EU. Whether you’re a business owner looking to cut communication costs or a developer seeking a flexible SMS integration, this module offers a powerful, tailored approach to SMS delivery.
At its core, the SMS Gateway module intercepts SMS messages originating from Odoo’s SMS system (typically sent via IAP) and redirects them through your chosen custom APIs—only when you want it to. This redirection is fully configurable, giving you the freedom to decide how and when to use external providers.
Imagine you’re running a business in India, where Odoo’s IAP charges 0.0320 credits which if the EUR rate is 90, will be ₹ 2.88 per SMS. With this module, you can integrate a local SMS provider offering messages at just ₹0.255 each or maybe even less. Simply configure a gateway, set the country prefix to +91, and any contact number starting with +91, 0091, or 91 will automatically use this affordable local API. Ta Da, Your savings start immediately!
But the cost-cutting doesn’t stop there. The module’s intelligent prefix-matching system lets you drill down even further. For example, in a country like Pakistan, SMS costs can vary significantly between mobile networks. If you have a local provider offering ultra-low rates for same-network messages (e.g., Mobilink to Mobilink), you can set a gateway with a network-specific prefix like +9230. When a contact’s number begins with +9230, the module routes the message through this gateway, ensuring it’s sent via the Mobilink network to another Mobilink recipient. This precision slashes costs even more, making bulk SMS campaigns or customer notifications incredibly economical.
Flexibility is a cornerstone of this module. You’re not locked into a single provider or approach. Configure multiple gateways with different prefixes—say, one for +91 (India), another for +9230 (Pakistan Mobilink), and a third for +1202 (US)—and the module will intelligently select the right gateway based on the recipient’s number. If no prefix matches, you’re still covered. The module includes configuration settings (res.config.settings) that let you define a default custom gateway. If that fails or isn’t set, and you’ve enabled the IAP fallback option, it gracefully hands off the message to Odoo’s IAP service. This ensures no message goes undelivered, balancing cost savings with reliability.
Technically, this module is a powerhouse for RESTful API integration. It
supports both
GET
and
POST
methods, with
POST
requests configurable as
either form data or JSON payloads. Need custom headers like
Authorization: Bearer {token}? It’s
got you covered. Want to define dynamic parameters tailored to your
API’s quirks? You can do that too. Whether your provider requires a
simple query string (e.g.,
?to={phone}&text={message}) or a
complex JSON body (e.g.,
{"recipients": "{phones}", "message": "{message}"}), this module adapts effortlessly. It even handles Unicode messages,
so you can send greetings in Arabic, Urdu, or any language your
customers understand.
In short, the SMS Gateway module transforms Odoo into a cost-efficient, globally adaptable SMS platform. It’s tightly integrated with Odoo’s SMS system, intercepting messages only when you choose, and redirecting them through custom gateways that align with your budget and region. From small businesses in emerging markets to enterprises with diverse customer bases, this module empowers you to communicate smarter, cheaper, and more effectively. Dive into this guide to unlock its full potential—whether you’re configuring a gateway via the intuitive UI or extending its capabilities as a developer! Best of all, integration is effortless. It works flawlessly with odoo current SMS module; just configure the gateway(s), and it automatically integrates with Odoo’s built-in SMS marketing, notification, and other features.
System Configuration Section
Gateway Menu
Gateway Tree View
Gateway Form View
Your Complete Guide to Sending SMS Messages with Odoo
Welcome to the Dynamic SMS Gateway (eis_sms_apis) module for Odoo! This powerful tool lets you send SMS messages directly from Odoo using your favorite providers—like Twilio, SendPK, or MSG91—without needing to be a tech expert. Designed for non-developers, this guide walks you through every step, from setup to sending messages, ensuring you can communicate with customers worldwide affordably and efficiently.
Why Use This Module? Odoo’s default SMS service (called IAP) can be expensive, especially outside the EU. Our module connects to local or global SMS providers, often at lower rates, and gives you full control over how messages are sent. Whether you’re in India, KSA, or the UK, we’ve got you covered with pre-built templates and easy customization.
Your Odoo administrator will install the module via the Apps menu. Once done, you’ll see:
You may need to activate Developers Tools
First Look: Open SMS Gateways to see templates like "Twilio (USA)" or "SendPK (Pakistan)". These are ready to customize!
The Dynamic SMS Gateway module replaces Odoo’s default SMS sending system with a flexible setup using SMS Gateways. Here’s how it works:
When you send an SMS (e.g., from a Contact), Odoo checks these settings and gateways to decide how to send it. Let’s dive into each part!
The SMS Configuration section in Settings > General Settings > Contact controls how Odoo sends SMS. These settings are stored in res.config.settings and decide whether to use gateways or Odoo’s IAP.
| Setting | What It Does | When It’s Used |
|---|---|---|
| Use IAP (sms.use_iap) | If checked ("True"), Odoo uses its default IAP service instead of gateways. |
|
| IAP Fallback (sms.iap_fallback) | If checked ("True"), Odoo falls back to IAP when no gateway matches a number. |
|
| Default Gateway (sms.sms_gateway_id) | Sets a fallback gateway if no prefix matches. |
|
When you send an SMS, Odoo decides which gateway to use based on the phone number. Here’s the exact process:
Phone number:
+923001234567
We’ve included over 37 pre-built gateway templates for providers like Twilio, SendPK, and Fast2SMS. These are ready-to-use setups based on real documentation, but they need your personal touch.
You need to enable developer mode.
demo
in API Key, Token, Username, or
Password.
Need a provider not in our templates? Create your own gateway with these steps.
https://api.mysms.com/send).
{phone}, {message}.
Key: Authorization, Value: Bearer {token}).
{"to": "{phone}", "text":
"{message}"}).
"id":"([A-Za-z0-9]+)".
| Field | Role | Example |
|---|---|---|
| Parameters | Data sent to the provider (e.g., phone number, message). |
Key: to, Value: {phone}
|
| Headers | Extra info sent with the request (e.g., authentication). |
Key: Authorization, Value: Bearer {token}
|
| JSON Body | Structured data for "POST" with "JSON" (replaces parameters). |
{"to": "{phone}", "text": "{message}"}
|
api.com/send?to={phone}).
to={phone}&message={message}).
{"to": "{phone}"}).
Placeholders are special tags replaced when sending SMS:
{phone}: Single phone number (e.g., "+923001234567").{phones}: Multiple numbers (e.g., "+92300,+92301").{message}: The SMS text (e.g., "Hello!").{api_key}, {token}, {username},
{password}: Your credentials.
How It Works:
Odoo swaps these with real values (e.g.,
{phone}
becomes "+92300…"). URLs, parameters, headers, and JSON bodies use these placeholders.
After sending an SMS, the provider replies with a response (e.g., "success" or an error). Odoo uses these fields to understand it:
| Field | Purpose | Example |
|---|---|---|
| Track Status | If checked, logs responses in SMS Statuses. | Check to see results. |
| Success HTTP Codes | Codes meaning "success". |
200,201
|
| Success Substring | Text in the response showing success. | OK,
sid
|
| Message ID Regex | Pattern to extract a tracking ID. |
"id":"([A-Za-z0-9]+)"
|
Example Response:
{"sid": "SM123", "status": "sent"}
"sid":"([A-Za-z0-9]+)"
grabs "SM123".
demo?latest version is the only version. Keep visit to see latest versions
Support
Send email to get support.
Send Messege on WhatsApp!