Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
An email list subscription service
Python
branch: master

add ja-jp to supported locales

latest commit 3b3c7efcd5
Alex Buchanan authored
Failed to load latest commit information.
apps nagios email backlog check should check whether subscriptions are active
cron add cron job for unsubscribing fxhome subscriptions after 10 days
emails
libs CSRF exempt piston resource
locale update japanese
migrations migration for adding country field
requirements L10n support for emails, and a lot of refactoring to support it.
templates L10n support for emails, and a lot of refactoring to support it.
wsgi wsgi
.gitignore
README.rst L10n support for emails, and a lot of refactoring to support it.
__init__.py Initial commit.
admin.py L10n support for emails, and a lot of refactoring to support it.
log_settings.py steal zamboni's logging
manage.py steal zamboni's logging
settings.py add ja-jp to supported locales
settings_ex.py L10n support for emails, and a lot of refactoring to support it.
urls.py ad nagios test point

README.rst

Basket

Stores email list subscriptions, and can send emails to those lists.

Requirements

  • Python 2.6
  • MySQL

Installation

Get the code

git clone git@github.com:abuchanan/basket.git

Make a virtualenv

Using virualenvwrapper:

mkvirtualenv basket

Install packages

pip install -r requirements/prod.txt -r requirements/compiled.txt

For developers:

pip install -r requirements/dev.txt

Settings

Create a settings_local.py file. Typical settings can be found in settings_ex.py NOTE: make sure you have from settings import * at the top, or you'll be confused when things aren't working correctly.

Database schema

./manage.py syncdb --noinput

Production environments

Production installs often have a few different requirements:

Collecting Emails

Send a POST request to /subscriptions/subscribe/ with the following fields

  • email address
  • campaign ID
  • locale (optional, defaults to en-US)
  • active (optional, defaults to True)
  • source, i.e. source page URL (optional)

Sending Emails

After collecting emails, you'll also want to send some. To do that, first set your outgoing email settings appropriately in settings_local.py.

Then, create an email. See ./emails/home.py for examples.

To send an email to a campaign, run:

./manage.py sendmail --email emails.package.email campaignname [other_campaignnames ...]

For example, to send the Firefox Home instructions email, you'd run:

./manage.py sendmail --email emails.home.Initial firefox-home-instructions

You can run this as a cron job, as no-one will receive the same email twice, unless the --force option is set.

Advanced emailing

If you require special logic for sending your email, you can subclass emailer.Emailer in a module of your choice (recommended: inside libs/custom_emailers). Set the emailer_class field accordingly for the applicable email (see emails.home.Reminder for an example).

When you run the sendmail command above, your Emailer will be used instead of the default one.

Something went wrong with that request. Please try again.