Boletin is a generic newsletter application for Django projects, which allows
for automatically generating and sending newsletters, with optional human
reviewing process if so desired.
Boletin means “bulletin” or “newsletter” in Spanish.
You can configure many aspects of the behavior of the application via
settings variables. Mandatory variables are marked with (*).
Email address from where to send the newsletter. Newsletter recipients
will see this address in the e-mail message “From” field.
Default: None, it’s mandatory.
Example:
NEWSLETTER_EMAIL = 'newsletter@example.com'
Email address for the newsletter reviewer. When a newsletter is generated,
an e-mail will be sent to this address prompting to the revision of the
newsletter.
Default: None.
Example:
NEWSLETTER_REVIEWER_EMAIL = 'reviewer@example.com'
Relative URL suffix for newsletter objects in the admin application. The site
domain and the newsletter id will be, respectively, prepended and appended to
this string. This setting is optional; if not defined, the e-mail message to
the reviewer will not include a link to the admin application.
Default: None.
Example:
NEWSLETTER_REVIEWER_ADMIN_LINK = '/admin/boletin/newsletter/'
This variable is a string pointing to a function inside the project which
will be responsible for retrieving content for inclusion in each newsletter.
The function must receive two parameters: from_date and to_date, which define
the datetime range of the newsletter being created.
Default: None, it’s mandatory.
Example:
NEWSLETTER_GENERATOR_FUNCTION = 'portal.newsletter.generate_content'
And the content of portal/newsletter.py:
from app1.models import FooModel
from app2.models import BarModel
def generate_content(from_date, to_date):
app1 = FooModel.objects.filter(date__gte=from_date, date__lte=to_date)
app2 = BarModel.objects.filter(date__gte=from_date, date__lte=to_date)
return {'app1': app1, 'app2': app2}
Available newsletter periods in the project. It’s a list with one or more of
‘D’ (daily), ‘W’ (weekly) and ‘M’ (monthly).
Default: ['W'] (only weekly newsletter)
Example:
NEWSLETTER_PERIODS = ['D', 'W', 'M'] # daily, weekly and monthly newsletters
Three management commands are included:
createnewsletter
sendnewsletter
shownewsletter
Generate a new newsletter for the given period (daily, weekly or monthly), both
in HTML and plain text. It renders the templates newsletter_email.html
and newsletter_email.txt.
Options:
-d, --daily: daily period.
-w, --weekly: weekly period.
-m, --monthly: monthly period.
-p, --print: print the created newsletter to stdout.
-r, --regenerate: create the newsletter again if it already exists.
One and only one of -d, -w or -m must be given.
Send newsletters to subscribers.
Options:
-n, --newsletter: send only the newsletter with the given ID.
-f, --force-unreviewed: send unreviewed newsletters.
Without parameters all reviewed newsletters with pending sendings are
sent. Use the -f switch to send unreviewed newsletters (useful for a
completely automatic newsletter system). Use the -n switch to send an
specific newsletter. The shownewsletters command should be useful to see
created newsletters, their IDs and pending statuses.
Show stored newsletters, with their object ID (different than their newsletter
number) and pending status.
Options:
You can get the last bleeding edge version of boletin by doing a checkout of
trunk in its subversion repository:
svn checkout https://svnpub.yaco.es/djangoapps/boletin/trunk boletin
Bug reports, patches and suggestions are more than welcome. Just put
them in our Trac system and use the ‘boletin’ component when you fill
tickets:
https://tracpub.yaco.es/djangoapps/