SMS Providers

  • Notification Type for all SMS Provider is sms
notification_type = 'sms'
  • Configuration settings can be passed as function arguments as well as in Environment Variable. The main AIM is to provide all
    possible flexibility to user to use Any Provider with any configuration.

> Plivo

Requirement
  • you need to install python plivo package to use this provider.
pip install plivo
  • Provider Type for all Plivo Provider is plivo
provider = 'plivo'
  • When you register at Plivo it will give you two keys which you need to configure in your Project.

As Environment Variable :

PLIVO_AUTH_ID

PLIVO_AUTH_TOKEN

As Function Arguments:

  • PLIVO_AUTH_ID as auth_id
  • PLIVO_AUTH_TOKEN as auth_token

Example Usage :

from notifyAll.services import notifier


def notify():
    """
    """
    data = {
        'source': '<source>',
        'destination': '<destination>',
        'notification_type': 'sms',
        'provider': 'plivo',
        'context': {
            'body': 'test message'
        },
    }

    notification = notifier.Notifier(**data)

    return notification.notify(auth_id='<plivo_auth_id>', auth_token='<plivo_auth_token>')

> Twilio

Requirement
  • you need to install python twilio package to use this provider.
pip install twilio
  • Provider Type for all Twilio Provider is twilio
provider = 'twilio'
  • When you register at Twilio it will give you two keys which you need to configure in your Project.

As Environment Variable :

TWILIO_ACCOUNT_SID

TWILIO_AUTH_TOKEN

As Function Arguments:

  • TWILIO_ACCOUNT_SID as account_sid
  • TWILIO_AUTH_TOKEN as auth_token
  • Usage is same as shown in Plivo provider example

> Msg91

Requirement
  • you need to install python requests package to use this provider.
pip install requests
  • Provider Type for all Twilio Provider is msg91
provider = 'msg91'
  • When you register at Msg91 it will give you one key which you need to configure in your Project.

As Django settings :

MSG91_AUTHKEY

Optional Settings

MSG91_PROMOTIONAL_ROUTE

  • Default value is 1

MSG91_TRANSACTIONAL_ROUTE

  • Default value is 4

As Function Arguments:

  • MSG91_AUTHKEY as auth_key
  • Usage is same as shown in Plivo provider example