For managing newsletter campaigns, the package will use a backend class, that implements a generic interface, and can be swapped out to use a different campaign provider, or to fine-tune the behaviour of an existing backend. Out of the box, the package will offer a Mailchimp specific backend.
Create a MailchimpCampaignBackend class with two methods:
get_audiences(): returns a list of audiences with (id, name, member_count).
get_audience_segments(audience_id: str): returns a list of segments, with (id, name, member_count), for a given audience.
The package should look up the WAGTAIL_NEWSLETTER_CAMPAIGN_BACKEND Django setting to get a dotted path for a backend class. It should default to MailchimpCampaignBackend.
For managing newsletter campaigns, the package will use a backend class, that implements a generic interface, and can be swapped out to use a different campaign provider, or to fine-tune the behaviour of an existing backend. Out of the box, the package will offer a Mailchimp specific backend.
Create a
MailchimpCampaignBackend
class with two methods:get_audiences()
: returns a list of audiences with (id
,name
,member_count
).get_audience_segments(audience_id: str)
: returns a list of segments, with (id
,name
,member_count
), for a given audience.The backend expects the following Django setting:
WAGTAIL_NEWSLETTER_MAILCHIMP_API_KEY
: the Mailchimp API key.The package should look up the
WAGTAIL_NEWSLETTER_CAMPAIGN_BACKEND
Django setting to get a dotted path for a backend class. It should default toMailchimpCampaignBackend
.