Available Settings

Here is a list of all available settings of django-campaign and their default values. All settings are prefixed with CAMPAIGN_, although this is a bit verbose it helps to make it easy to identify these settings.

CAMPAIGN_BACKEND

Default: 'campaign.backends.send_mail'

The backend used for the actual sending of the emails. The default backend campaign.backends.send_mail uses Django’s built-in e-mail sending capabilities.

Please see the backend docs about implementing your own backend.

CAMPAIGN_CONTEXT_PROCESSORS

Default: () (empty tuple)

Similar to Django’s Template Context Processors these are callables which take a Subscriber object as their argument and return a dictionary with items to add to the Template Context which is used to render the Mail.

CAMPAIGN_SUBSCRIBE_CALLBACK

Default: None

If CAMPAIGN_SUBSCRIBE_CALLBACK is configured the handling of newsletter subscriptions via django-campaign will be enabled.

You have to supply either a callable or an import-path to a callable, which accepts an email address as argument and returns either True or False to indicate if the action was performed successfully.

Example settings.py:

CAMPAIGN_SUBSCRIBE_CALLBACK = "myproject.newsletter.utils.subscribe"

Example implementation of the callback in your app:

def subscribe(email):
    s,c = Subscriber.objects.get_or_create(email=email,
                                         defaults={'newsletter': True})
    return True

It’s up to you to decide where to store the Subscribers, as django-campaign is completely agnostic in this point. One or more Subscriber models can be defined via the admin interface for the SubscriberList model.

CAMPAIGN_UNSUBSCRIBE_CALLBACK

Default: None

Please see CAMPAIGN_SUBSCRIBE_CALLBACK above and replace subscribe with unsubscribe.

Table Of Contents

Previous topic

Installation

Next topic

Backends

This Page