Reusable application for Django introducing a message delivery framework
Project description
https://github.com/idlesign/django-sitemessage
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, telegram, facebook, vkontakte, etc.);
Message Types - message classes exposing message composition logic (plain text, html, etc.).
Configure messengers for your project (create sitemessages.py in one of your apps):
from sitemessage.toolbox import register_messenger_objects, register_builtin_message_types
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)
)
# And register built-in message types we'd use (for Django < 1.7).
register_builtin_message_types()
Schedule messages for delivery when and where needed (e.g. in a view):
from sitemessage.shortcuts 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)
...
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
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
Built Distribution
Hashes for django-sitemessage-0.10.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9090e961aed0b779f6df2f393ddeb1721892936a5433626de732b9205117ca89 |
|
MD5 | 616e04c87f0f46649d9882ea8e84d73b |
|
BLAKE2b-256 | 3af1bc3ba421a35e218d20bb56d89e661b26222908fd8aea6a83f19c0726e065 |
Hashes for django_sitemessage-0.10.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a949c480ff491ddea96772b3a5a3ddf5e7de9fc1267c837b19fbfb6c01cce6e0 |
|
MD5 | fc0ce222db78f39dfa674841dfea2c40 |
|
BLAKE2b-256 | 41a7519f1ad5bc68e7fe0a1cf55f76bc69e51d96903ae3404432fecfda841dda |