Installation and Usage¶
Installation¶
Usage¶
- import notifier from notifyAll services as :
from notifyAll.services import notifier
- Then call notifier.Notifier(), there are some required params which are as follows:
source¶
This signifies who wants to send notification.
destination¶
To whom you want to send notification.
notification_type¶
This signifies the Notification type available options are
sms, email or push.Note : push Notification support is not available yet,
provider¶
Type of Provider e.g.,plivo, twilio, gmail etc, for more info visit Provider page for that.
context¶
All other information will come under context, it is of type
dict. e.g., notification body, cc, bcc or attachement in case of email.
- Possible keys of context :
- body :
- Body of Notification.
- cc :
- For email provider only.
- bcc :
- For email provider only.
- attachment :
- For email provider only.
- html_message :
- For email provider only. If you want to send message including HTML then you need to send your notification body in the above key.
Example Usage :
from notifyAll.services import notifier def notify(): """ """ context = { 'subject': 'subject' 'body': 'body' 'html_message': '<h1>html message</h1>' } data = { 'source': 'admin@example.com', 'destination': 'me@example.com', 'notification_type': 'email', 'provider': 'gmail', 'context': context, } notification = notifier.Notifier(**data) return notification.notify()
For more information about usage visit our Example project.