SMS Providers¶
- Notification Type for all SMS Provider is
sms
notification_type = 'sms'
- General Settings you need to configure in Django Project when using any email providers are mentioned below :
- Some settings can be passed as function arguments as well as in Django settings. The main AIM is to provide all
- possible flexibility to user to use Any Provider with any configuration.
- If we Add settings in Django settings then in entire project those settings will be used But if you want every
- notification use different provider configuration then that is also possible here.
> 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 Django Project.
As Django settings :
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 Django Project.
As Django settings :
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