Skip to main content

Django package that handles sending of notifications

Project description

# UNICEF Notification

Notification is a library that provides handles sending of notifications.

## Installation

pip install unicef-notification

## Setup

Add ``unicef_notification`` to ``INSTALLED_APPS`` in settings


Add ``POST_OFFICE`` configuration to settings;

'default': 'djcelery_email.backends.CeleryEmailBackend'

Update ``TEMPLATES`` in settings by adding ``EmailTemplateLoader`` and marking ``APP_DIRS`` as ``False``

'APP_DIRS': False, # False because we set loaders manually below
'loaders': [

### Optional

If you want to override the notification template directory to be used;


This is the directory where notifcation templates are to be placed in your applications.
These are loaded with the `upload_notifications` management command.

If you want to override the email template prefix;


## Usage

Create notification template in defined `UNICEF_NOTIFICATION_TEMPLATE_DIR` from setup.

name = "<unique name for notification">
defaults = {
"description": "Sample notification",
"subject": "Subject of notification",
"content": "Content of notification",
"html_content": "Notificaton content in HTML format",

Update the notifications;

python update_notifications

Send notification with template;

from unicef_notification.utils import send_notification_with_template

context = {}

Send notification without a template;

from unicef_notification.utils import send_notification

subject="Subject of notification",
content="Content of notification",
html_content="Notification content in HTML format",

## Contributing

### Environment Setup

To install the necessary libraries

$ make install

### Coding Standards

See `PEP 8 Style Guide for Python Code <>`_ for complete details on the coding standards.

To run checks on the code to ensure code is in compliance

$ make lint

### Testing

Testing is important and tests are located in `tests/` directory and can be run with;

$ make test

Coverage report is viewable in `build/coverage` directory, and can be generated with;

### Project Links

- Continuos Integration -
- Source Code -

Project details

Download files

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

Files for unicef_notification, version 0.2.1
Filename, size File type Python version Upload date Hashes
Filename, size unicef_notification-0.2.1.tar.gz (16.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page