Alternative providers for SMS
Base module for implementing alternative SMS gateways
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.
Important
This is an alpha version, the data model and design can change at any time without warning. Only for development or testing purpose, do not use in production. More details on development status
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
Authors
- Hunki Enterprises BV
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.
Once the user has seen at least one product this snippet will be visible.





