Skip to content

Configure multiple campaign backends #61

@mgax

Description

@mgax

Use a dictionary à la Django's database / cache settings (and Wagtail's search backends) for this e.g.

WAGTAIL_NEWSLETTER_BACKENDS = {
    "default": {
        "BACKEND": "wagtail_newsletter.campaign_backends.mailchimp.MailchimpCampaignBackend",
        "API_KEY": "...",
    },
    "otherservice": {
        "BACKEND": "someotherservice.backends.SomeOtherServiceCampaignBackend",
        "APP_ID": "...",
        "SECRET_KEY": "...",
        # or maybe wrap the credentials inside an `OPTIONS` key
    }
}

Different models can use different backends (or maybe you can select which service to use in the newsletter panel). It would also allow passing other options which may be backend-specific without having to define a top-level setting for each option.

#50 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions