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
File details
Details for the file django-sitemessage-0.9.1.tar.gz
.
File metadata
- Download URL: django-sitemessage-0.9.1.tar.gz
- Upload date:
- Size: 51.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d921e2b92e7c8fe54142e5816d341fda69a64dffe3034e2560f2eae3ae185715 |
|
MD5 | 2cbe37c0a6993d7017e5479778a60820 |
|
BLAKE2b-256 | fff0cf7d03f1b11128e17d2f44f56ac0a321e59a8beb3ba415c374d6d581fb29 |
File details
Details for the file django_sitemessage-0.9.1-py2.py3-none-any.whl
.
File metadata
- Download URL: django_sitemessage-0.9.1-py2.py3-none-any.whl
- Upload date:
- Size: 53.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6f5e212cb402ca7783a8cb046bd1ae7d0c275c0ac1aaa816499d35f0dbc7313 |
|
MD5 | d4256cc599d64e6030d5b879a0b180eb |
|
BLAKE2b-256 | 2edf378d95636c3636f785660e599b880c4b8554c2a0f8b00bab57cd66ccb1af |