Alternative providers for SMS
This module allows configuring multiple providers for sending SMS.
By restricting providers to country or area codes, you can ie have Odoo pick different providers for different countries.
Table of contents
Configuration
To configure this module, you need to:
Go to Settings / Technical / Phone/SMS / SMS providers
Create/Edit providers, reorder them, restrict some provider to certain country or area codes
Usage
This module doesn’t do anything on its own, it is meant to be used by developers to implement SMS providers.
To do this, it suffices to inherit the ir.sms.gateway model to add a type:
gateway_type = fields.Selection(selection_add=[("your_sms_provider", "Your SMS provider")])
and declare a function named like _send_$type:
def _send_your_sms_provider(self, messages):
# do here whatever you need to send the list of messages:
# [{
# 'id': id of the sms.sms record (may not be set),
# 'number': the number to send the sms to
# 'content': the content of the message
# }]
# return a list of dicts with sending results:
# [{
# 'id': id of the sms.sms record
# 'state': sms.sms#state
# 'failure_type': sms.sms#failure_type if state == 'error'
# # whatever other fields you want to write on the sms.sms record after sending,
# # such as provider-specific extra information
# }]
Probably your provider needs some api key or similar to function, add those fields prefixed with your gateway_type name to the gateway class:
your_sms_provider_apikey = fields.Char('API key')
and add a group after group general in the form view of the model:
<group name="general" position="after">
<group name="your_sms_provider" attrs="{'invisible': [('gateway_type', '!=', 'your_sms_provider')]}">
<field name="your_sms_provider_apikey" password="True" attrs="{'required': [('gateway_type', '=', 'your_sms_provider')]}" />
</group>
</group>
Bug Tracker
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.
Do not contact contributors directly about support or help with technical issues.
Credits
Contributors
Holger Brunn <mail@hunki-enterprises.com> (https://hunki-enterprises.com)
Maintainers
This module is maintained by the OCA.
OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.
Current maintainer:
This module is part of the OCA/connector-telephony project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Release files for odoo-addon-sms-alternative-provider 16.0.1.0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| odoo_addon_sms_alternative_provider-16.0.1.0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Release files / odoo_addon_sms_alternative_provider-16.0.1.0.0.2-py3-none-any.whl
| Download URL | odoo_addon_sms_alternative_provider-16.0.1.0.0.2-py3-none-any.whl |
|---|---|
| Size | 33.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c07be78800e0bf04458364794169ec52b80591d57a690b70d4529247decc3ab4
|
|
BLAKE2b-256 checksum How to use checksums |
7304d8c5ff450655eae21704a7173d066639aa5a6a20df2f9a89c8440ed4cd71
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|