Skip to main content

A Django app to send push notifications to to users.

Project description

Mad Notifications

Mad Notifications app for django to send notifications to the user

Quick start

  1. Add "mad_notifications" to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = [
        ...
        'mad_notifications',
    ]
    
  2. Include the notifications URLconf in your project urls.py like this:

    path('notifications/', include('mad_notifications.api.urls')),
    
  3. Run python manage.py migrate to create the notifications models.

Usage

from mad_notifications.notification import Notification
# create a notification
notification = Notification(
    user = user,
    title = "New Order",
    content = "You have a new order!",
    data = {
        'order': order_data,
    },
    actions = {
        'click_action': "ORDER_SCREEN"
    }
)
# send the notification
notification.notify()

Overriding default

MAD_NOTIFICATIONS = {
    "FIREBASE_MOBILE_PUSH_NOTIFICATION_CLASS": "mad_notifications.senders.firebase.FirebaseMobilePushNotification",
    "EMAIL_NOTIFICATION_CLASS": "mad_notifications.senders.email.EmailNotification",
}

Developer Guide

Setting up a new provider

Create logic in ~/sendenrs/PROVIDER.py and call via tasks in ~/notify/PROVIDER.py

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

mad_notifications-1.4.1.tar.gz (13.5 kB view hashes)

Uploaded Source

Supported by

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