Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
An email newsletter application for the Django web application framework, including an extended admin interface, web (un)subscription, dynamic e-mail templates, an archive and HTML email support.
Python Makefile Shell

This branch is 274 commits behind master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.tx
newsletter
seleniumtests
test_templates
.gitignore
.travis.yml
AUTHORS
COPYRIGHT
LICENSE
MANIFEST.in
README.rst
distribute_setup.py
django-newsletter.tmproj
graph_models.dot
graph_models.png
requirements.txt
setup.py
test_settings.py
test_urls.py

README.rst

django-newsletter

https://secure.travis-ci.org/dokterbob/django-newsletter.png

Newsletter application for the Django web framework.

What is it?

Django app for managing multiple mass-mailing lists with both plaintext as well as HTML templates with rich text widget integration, images and a smart queueing system all right from the admin interface.

Status

We are currently using this package in several large to medium scale production environments, but it should be considered a permanent work in progress.

Translations

Most if not all strings are available in Dutch, German and English. Contributions to translations are welcome through Transifex.

https://www.transifex.com/projects/p/django-newsletter/resource/django/chart/image_png

Requirements

Please refer to requirements.txt for an updated list of required packes.

Installation

  1. Get it from the Cheese Shop:

    pip install django-newsletter
    

    Or get the latest & greatest from Github and link it to your application tree:

    pip install -e git://github.com/dokterbob/django-newsletter.git#egg=django-newsletter
    

    (In either case it is recommended that you use VirtualEnv in order to keep your Python environment somewhat clean.)

  2. Add newsletter and to INSTALLED_APPS in settings.py and make sure that your favourite rich text widget, some Django contrib dependencies and django-extensions (for the submission jobs) are there as well:

    INSTALLED_APPS = (
        'django.contrib.contenttypes',
        'django.contrib.sessions',
        'django.contrib.auth',
        'django.contrib.sites',
        ...
        'imperavi',
        'django_extensions',
        ...
        'newsletter',
        ...
    )
    
  3. Set the path to your preferred rich text widget (optional). If not set, django-newsletter will fall back to Django's default TextField widget:

    # Using django-imperavi
    NEWSLETTER_RICHTEXT_WIDGET = "imperavi.widget.ImperaviWidget"
    
    # Using django-tinymce
    NEWSLETTER_RICHTEXT_WIDGET = "tinymce.widgets.TinyMCE"
    
  4. Import subscription, unsubscription and archive URL's somewhere in your urls.py:

    urlpatterns = patterns('',
        ...
        (r'^newsletter/', include('newsletter.urls')),
        ...
    )
    
  5. Enable Django's staticfiles app so the admin icons, CSS and JavaScript will be available where we expect it.

  6. Create required data structure and load default template fixture:

    ./manage.py syncdb
    ./manage.py loaddata default_templates
    
  7. Change the default contact email listed in templates/newsletter/subscription_subscribe.html and templates/newsletter/subscription_update.html.

  8. Run the tests to see if it all works:

    ./manage.py test
    

    If this fails, please contact me! If it doesn't: that's a good sign, chap. You'll probably have yourself a working configuration!

  9. Add jobs for sending out mail queues to crontab:

    @hourly /path/to/my/project/manage.py runjobs hourly
    @daily /path/to/my/project/manage.py runjobs daily
    @weekly /path/to/my/project/manage.py runjobs weekly
    @monthly /path/to/my/project/manage.py runjobs monthly
    

Usage

  1. Start the development server: ./manage.py runserver
  2. Navigate to /admin/ and: behold!
  3. Put a submission in the queue.
  4. Submit your message with ./manage.py runjob submit
  5. For a proper understanding, please take a look at the model graph.
https://github.com/dokterbob/django-newsletter/raw/master/graph_models.png

Unit tests

Fairly extensive tests are available for internal frameworks, web (un)subscription and mail sending. Sending a newsletter to large groups of recipients (+10k) has been confirmed to work in multiple production environments. Tests for pull req's and the master branch are automatically run through Travis CI.

License

This application is released under the GNU Affero General Public License version 3.

Something went wrong with that request. Please try again.