Availability |
Odoo Online
Odoo.sh
On Premise
|
Odoo Apps Dependencies |
Discuss (mail)
|
Lines of code | 306 |
Technical Name |
masafah_sms |
License | OPL-1 |
Website | https://websers.odoo.com |
Versions | 18.0 |
Availability |
Odoo Online
Odoo.sh
On Premise
|
Odoo Apps Dependencies |
Discuss (mail)
|
Lines of code | 306 |
Technical Name |
masafah_sms |
License | OPL-1 |
Website | https://websers.odoo.com |
Versions | 18.0 |
Summary
This module integrates the Masafah SMS provider (client.almasafa.ly) with Odoo. It allows you to configure your Masafah account within Odoo and use it as your default SMS provider, routing messages through Masafah's API instead of Odoo's default IAP SMS service.
Description
The Masafah SMS Integration module overrides Odoo's standard SMS sending mechanism. By configuring and setting a Masafah account as the 'Default SMS Provider', all outgoing SMS messages (sent individually or via mass mailing/batch features) will be sent using your Masafah credentials and credit balance. If no default Masafah account is active, Odoo will revert to its standard SMS sending behaviour (typically using IAP credits).
Screenshots
Module in Apps List:

Masafah SMS Account Configuration (General Settings -> Technical -> Masafah SMS):



Sending SMS from a Contact:


Key Features
- Direct Masafah Integration: Send SMS via the official Masafah API.
- Default Provider Override: Seamlessly replaces Odoo's IAP SMS when configured as default.
- Single & Batch Sending: Handles both individual SMS and Odoo's batch/mass SMS features (sending one-by-one via API).
- Account Management: Configure and store credentials for one or more Masafah accounts.
- Balance Check: View your current Masafah balance (package, spent, remaining) directly within the account configuration in Odoo.
- Connection Testing: Verify API credentials and connectivity.
- IAP Fallback: Odoo's standard SMS sending is used if no default Masafah account is set.
Dependencies
- Odoo Modules:
iap
,sms
,phone_validation
- Python Libraries:
requests
(usually included with Odoo)
Installation
- Download: Obtain the
masafah_sms
module folder. - Place in Addons: Copy the
masafah_sms
folder into your Odoo custom addons directory. - Update Apps List: Restart Odoo, activate developer mode, and go to Apps -> Update Apps List.
- Install: Search for "Masafah SMS Integration" and click "Install".
Configuration
Configure your Masafah SMS account details within Odoo:
- Navigate to Settings → Technical → Masafah SMS.
(Alternative path based on menu structure: Settings → General Settings → Masafah SMS)
- Click Create to add a new account configuration.
- Fill in the required details:
- Account Name: A recognizable name (e.g., "Masafah Main Account").
- API Username: Your Masafah API username.
- API Password: Your Masafah API password.
- Sender ID: The Sender ID approved for your Masafah account.
- Authentication URL: The Masafah API endpoint for authentication (defaults provided).
- SMS API URL: The Masafah API endpoint for sending SMS (defaults provided).
- Balance API URL: The Masafah API endpoint for checking balance (defaults provided).
- Default SMS Provider: Crucially, check this box to make this account the active provider for sending SMS. Only one account should be marked as default.
- Test Connection: Click the Test Authentication button to verify your Username/Password and Auth URL.
- Check Balance:
- The Account Balance section displays the last checked balance details (Package, Spent, Balance) and the time of the check.
- Click the Refresh Balance button (🔄 icon) next to the balance display to fetch the latest balance information from Masafah.
- Save the configuration.
Usage
- Automatic Sending: Once a Masafah account is saved and marked as the Default SMS Provider, any SMS sent from Odoo (e.g., via Contact form, Sales Order confirmation, SMS Marketing app) will automatically use this account.
- Balance Monitoring: Periodically check the balance on the configuration screen using the Refresh Balance button to ensure sufficient credits.
- Logs: Sent message history and status can be viewed in the standard Odoo Settings -> Technical -> Email -> SMS Messages menu.
Important Notes
- The Masafah API used by this module sends messages one recipient at a time. Therefore, even when using Odoo's batch sending features, the module will make individual API calls for each recipient in the batch.
- Ensure your Masafah account has sufficient balance and is active.
Technical Details
- The module defines a
masafah.sms.account
model inheriting fromiap.account
to store credentials and manage the connection. - It implements the necessary methods (
_send_sms
,_send_sms_batch
) required by Odoo's SMS framework (leveragingiap.account
features) to route messages through the configured default Masafah account. - API communication uses the
requests
Python library. Error handling and logging are included for troubleshooting.
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module