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, 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.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)
)
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)
...
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
File details
Details for the file django-sitemessage-0.4.0.tar.gz
.
File metadata
- Download URL: django-sitemessage-0.4.0.tar.gz
- Upload date:
- Size: 32.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7c84887ce1c602b17b2c57ca1111068347c5594880b4b83a56c2dd0b9c9315c |
|
MD5 | 62bcfc4a714c424d0e158230705c77cc |
|
BLAKE2b-256 | 6979055b755c3fc59ca91f36c3d15169ee7cb65c5ff33f3e58f220d3337092cb |