Skip to main content

Base module for implementing alternative SMS gateways

Project description

Odoo Community Association

Alternative providers for SMS

Alpha License: AGPL-3 OCA/connector-telephony Translate me on Weblate Try me on Runboat

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:

  1. Go to Settings / Technical / Phone/SMS / SMS providers

  2. 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

Maintainers

This module is maintained by the OCA.

Odoo Community Association

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:

hbrunn

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file odoo_addon_sms_alternative_provider-16.0.1.0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for odoo_addon_sms_alternative_provider-16.0.1.0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c07be78800e0bf04458364794169ec52b80591d57a690b70d4529247decc3ab4
MD5 d3c1f7502818c5bf34c29740d04cda7b
BLAKE2b-256 7304d8c5ff450655eae21704a7173d066639aa5a6a20df2f9a89c8440ed4cd71

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page