Skip to main content

Reusable application for Django introducing a message delivery framework

Project description

https://github.com/idlesign/django-sitemessage

https://badge.fury.io/py/django-sitemessage.png https://pypip.in/d/django-sitemessage/badge.png

Description

Reusable application for Django introducing a message delivery framework.

Schedule and send messages with several easy steps, using concepts of:

  • Messengers - clients for various protocols (smtp, jabber, twitter, etc.);

  • Message Types - message classes exposing message composition logic (plain text, html, etc.).

  1. Configure messengers for your project (create sitemessages.py in one of your apps):

from sitemessage.utils import register_messenger_objects
from sitemessage.messengers.smtp import SMTPMessenger

register_messenger_objects(
    # Here we register only one messenger to deliver emails.
    SMTPMessenger('user1@host.com', 'user1', 'user1password', host='smtp.host.com', use_tls=True)
)
  1. Schedule messages for delivery when and where needed (e.g. in a view):

from sitemessage.schortcuts import schedule_email

def send_mail_view(request):
    ...

    # Suppose `user_model` is a recipient Django User model instance.
    user1_model = ...

    # We pass `request.user` into `sender` to keep track of senders.
    schedule_email('Message from sitemessage.', [user1_model, 'user2@host.com'], sender=request.user)

    ...
  1. Periodically run Django management command from wherever you like (cli, cron, Celery, etc.):

    ./manage.py sitemessage_send_scheduled

And that’s only the tip of sitemessage iceberg, read the docs %)

Documentation

http://django-sitemessage.readthedocs.org/

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-sitemessage-0.3.0.tar.gz (28.9 kB view details)

Uploaded Source

File details

Details for the file django-sitemessage-0.3.0.tar.gz.

File metadata

File hashes

Hashes for django-sitemessage-0.3.0.tar.gz
Algorithm Hash digest
SHA256 959399d962de8a8d2d0c9cf3466ccb3bd998b0a975eff93c34b12ba39be9e46b
MD5 2afe2f01c0284915eda55b0eb88901da
BLAKE2b-256 82c5a0ecc308547c1df4d335e973f0cf71de667625f2bbaad6c7f848373b3577

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