Skip to main content

django-email-notification allows backoffice users to send short email notifications to django registered users or users you only know the email about what is new or changed from django's admin or a dedicated view. And then track their clicks.

Project description

Notifications are short emails sent to users by Facebook or Twitter to inform users of some changes.

django-email-notification allows backoffice users to send short email notifications to django registered users or users you only know the email about what is new or changed from django’s admin or a dedicated view. And then track their clicks.

settings:

NOTIFICATION_FROM_EMAIL = ''  # sender email, typically no-reply@you-site.com
NOTIFICATION_FROM_NAME = ''   # sender name
NOTIFICATION_UNSUBSCRIBE_REDIRECT = '/you-unsubscribed/'  # possible page redirection after unsubscription
NOTIFICATION_REGISTRATION_MESSAGE_TAG = 'notification'  # allow filtering notification messages

# Description of linkable objects.
NOTIFICATION_ASSOCIATED_OBJECTS = (
    {   'name': 'products',                                     # reference name, used in forms and templates
        'description': u"New products",                         # Human readable description
        'long_description': u"Last products added to our site", # Long description
        'class': 'project.application.models.Product',          # path to the class model
        'title_attr': 'product_description',                    # Model instance field or callable to display in form
        'order_by': '-creation_date',                           # order to sort Model instances in form and email template
        'manager': '',                                          # manager to use if so
    },
)

Email template:

In template, linked objects can be processed this way by example:

{% if object_types.OBJECT_NAME.instances %}
    <ul><li>{{ object_types.OBJECT_NAME.long_description }}
    <ul>{% for instance in object_types.OBJECT_NAME.instances %}
    <li>{% include 'notification/emails/tracked_link.html' %}</li>
    {% endfor %}</ul>
    </li></ul>
{% endif %}

Messages sent through the django messages framework filtered like this:

{% if messages %}
    {% for message in messages %}
        {% if 'notification' in message.tags %}
            <span class="email-registration-message lvl-{{ message.level }}">{{ message }}</span>
        {% endif %}
    {% endfor %}
{% endif %}

Project details


Download files

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

Source Distribution

django-email-notification-1.2.1.tar.gz (24.0 kB view details)

Uploaded Source

File details

Details for the file django-email-notification-1.2.1.tar.gz.

File metadata

File hashes

Hashes for django-email-notification-1.2.1.tar.gz
Algorithm Hash digest
SHA256 f1cd0a58eefb166466d9b8a95b4cba0c4a5cc3300dd0b4319f980490ce6e075b
MD5 7a53883c25eb39da5bebadedd4360697
BLAKE2b-256 043171fed04c19fcca8a5b4841b918d4882ab2cea96cb5e32471043d53c51a1a

See more details on using hashes here.

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