<commit_before>django-courriers
================

.. image:: https://secure.travis-ci.org/ulule/django-courriers.png?branch=master
    :alt: Build Status
    :target: http://travis-ci.org/ulule/django-courriers

A generic application to manage your newsletters

Compatibility
-------------

This library is compatible with:

- python2.6, django1.4
- python2.6, django1.5
- python2.6, django1.6
- python2.7, django1.4
- python2.7, django1.5
- python2.7, django1.6
- python3.3, django1.5
- python3.3, django1.6

What it does?
-------------

django-courriers has three models:

- ``NewsletterList`` which represents a newsletter list.
- ``Newsletter`` which represents a newsletter.
- ``NewsletterItem`` an item of a newsletter. It could be a content-type you want.
- ``NewsletterSubscriber`` which represents a user who is subscribed to a newsletter.


You have the choice between three backends to manage and send your emails:

- ``SimpleBackend``, a simple backend to send emails with Django and
  your current smtp configuration
- ``MailchimpBackend``, a `Mailchimp`_ backend which uses `mailchimp library`_
- ``MailJetBackend``, a `Mailjet`_ backend, which will be available soon


Installation
------------

1. Download the package on GitHub_ or simply install it via PyPi
2. Add ``courriers`` to your ``INSTALLED_APPS`` ::

    INSTALLED_APPS = (
        'courriers',
    )

3. Sync your database using ``syncdb`` command from django command line
4. Configure settings

You have to specify which backend you want to use in your settings ::

    COURRIERS_BACKEND_CLASS = 'courriers.backends.simple.SimpleBackend'

A quick reminder: you can also set your custom ``DEFAULT_FROM_EMAIL`` in Django settings.

Backends
--------

courriers.backends.simple.SimpleBackend
........................................

A simple backend to send your emails with Django and
your current smtp configuration

courriers.backends.mailchimp.MailchimpBackend
..............................................

A backend to manage your newsletters with Mailchimp.


What you need to do for mailchimp
.................................

- Create an account on Mailchimp
- Get your API key
- Add it to your settings with others options as described below
- Install the `mailchimp library`_
- Create a list or more if you have users
  from different countries (see multilingual section below)

Which this backend you have to provide additional settings ::

    COURRIERS_MAILCHIMP_API_KEY = 'Your API key'
    COURRIERS_DEFAULT_FROM_NAME = '<NAME>'


Where the suffix language code is one of Django language code.

See `available languages codes`_.

.. _GitHub: https://github.com/ulule/django-courriers
.. _Available languages codes: https://github.com/django/django/tree/master/django/conf/locale
.. _Mailchimp: http://mailchimp.com/
.. _Mailjet: https://eu.mailjet.com/
.. _mailchimp library: https://pypi.python.org/pypi/mailchimp<commit_msg>Update README for mailjet<commit_after>django-courriers
================

.. image:: https://secure.travis-ci.org/ulule/django-courriers.png?branch=master
    :alt: Build Status
    :target: http://travis-ci.org/ulule/django-courriers

A generic application to manage your newsletters

Compatibility
-------------

This library is compatible with:

- python2.6, django1.4
- python2.6, django1.5
- python2.6, django1.6
- python2.7, django1.4
- python2.7, django1.5
- python2.7, django1.6
- python3.3, django1.5
- python3.3, django1.6

What it does?
-------------

django-courriers has three models:

- ``NewsletterList`` which represents a newsletter list.
- ``Newsletter`` which represents a newsletter.
- ``NewsletterItem`` an item of a newsletter. It could be a content-type you want.
- ``NewsletterSubscriber`` which represents a user who is subscribed to a newsletter.


You have the choice between three backends to manage and send your emails:

- ``SimpleBackend``, a simple backend to send emails with Django and
  your current smtp configuration
- ``MailchimpBackend``, a `Mailchimp`_ backend which uses `mailchimp library`_
- ``MailJetBackend``, a `Mailjet`_ backend which uses `mailjet library`_


Installation
------------

1. Download the package on GitHub_ or simply install it via PyPi
2. Add ``courriers`` to your ``INSTALLED_APPS`` ::

    INSTALLED_APPS = (
        'courriers',
    )

3. Sync your database using ``syncdb`` command from django command line
4. Configure settings

You have to specify which backend you want to use in your settings ::

    COURRIERS_BACKEND_CLASS = 'courriers.backends.simple.SimpleBackend'

A quick reminder: you can also set your custom ``DEFAULT_FROM_EMAIL`` in Django settings.

Backends
--------

courriers.backends.simple.SimpleBackend
........................................

A simple backend to send your emails with Django and
your current smtp configuration

courriers.backends.mailchimp.MailchimpBackend
..............................................

A backend to manage your newsletters with Mailchimp.

courriers.backends.mailjet.MailjetBackend
..............................................

A backend to manage your newsletters with Mailjet.


What you need to do for mailchimp
.................................

- Create an account on Mailchimp
- Get your API key
- Add it to your settings with others options as described below
- Install the `mailchimp library`_
- Create a list or more if you have users
  from different countries

Which this backend you have to provide additional settings ::

    COURRIERS_MAILCHIMP_API_KEY = 'Your API key'
    COURRIERS_DEFAULT_FROM_NAME = 'Your name'


What you need to do for mailjet
.................................

- Create an account on Mailjet
- Get your API key and API Secret key
- Add it to your settings with others options as described below
- Install the `mailjet library`_
- Create a list or more if you have users
  from different countries

Which this backend you have to provide additional settings ::

    COURRIERS_MAILJET_API_KEY = 'Your API key'
    COURRIERS_MAILJET_API_SECRET_KEY = 'Your API Secret key'
    COURRIERS_DEFAULT_FROM_NAME = 'Your name'

.. _GitHub: https://github.com/ulule/django-courriers
.. _Mailchimp: http://mailchimp.com/
.. _Mailjet: https://eu.mailjet.com/
.. _mailchimp library: https://pypi.python.org/pypi/mailchimp
.. _mailjet library: https://pypi.python.org/pypi/mailjet/
{'fraction_non_alphanumeric': 0.14654493939870927, 'fraction_numerical': 0.01133322839603337, 'mean_word_length': 3.0342857142857143, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '440288', 'n_tokens_mistral': 1865, 'n_tokens_neox': 1828, 'n_words': 661}