Metadata-Version: 2.1
Name: django-sitemessage
Version: 1.3.1
Summary: Reusable application for Django introducing a message delivery framework
Home-page: https://github.com/idlesign/django-sitemessage
Author: Igor `idle sign` Starikov
Author-email: idlesign@yandex.ru
License: BSD 3-Clause License
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: License :: OSI Approved :: BSD License
License-File: LICENSE
License-File: AUTHORS
Requires-Dist: django-etc>=1.2.0

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

.. image:: https://idlesign.github.io/lbc/py2-lbc.svg
   :target: https://idlesign.github.io/lbc/
   :alt: LBC Python 2

----

.. image:: https://img.shields.io/pypi/v/django-sitemessage.svg
    :target: https://pypi.python.org/pypi/django-sitemessage

.. image:: https://img.shields.io/pypi/l/django-sitemessage.svg
    :target: https://pypi.python.org/pypi/django-sitemessage

.. image:: https://img.shields.io/coveralls/idlesign/django-sitemessage/master.svg
    :target: https://coveralls.io/r/idlesign/django-sitemessage

.. image:: https://travis-ci.org/idlesign/django-sitemessage.svg?branch=master
    :target: https://travis-ci.org/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.).


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

.. code-block:: python

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

    register_messenger_objects(
        # Here we register one messenger to deliver emails.
        # By default it uses mailing related settings from Django settings file.
        SMTPMessenger()
    )


2. Schedule messages for delivery when and where needed (e.g. in a view):

.. code-block:: python

    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)

        ...


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

    ./manage.py sitemessage_send_scheduled


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


Documentation
-------------

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