save_campaign(campaign_id: str | None, recipients: NewsletterRecipients, subject: str, content: str): create or update a campaign.
To allow the integration of newsletter providers that don't support updating a campaign, and thus require deleting and recreating it to simulate an update, the method should return the ID of the campaign.
send_test_email(campaign_id: str, email_address: str): send a test email for the campaign.
The send_test_email method will expect the following Django settings to be defined:
WAGTAIL_NEWSLETTER_FROM_NAME: name of the email sender.
WAGTAIL_NEWSLETTER_REPLY_TO: email address of the email sender.
Here is a sample implementation of creating a campaign and sending a test email with Mailchimp:
In the page editor, on the newsletter tab, when clicking on Send test email, it should display a dialog, asking for an email address, with a Send button. Behind the scenes, this will call the backend to create/update the campaign and to send a test email.
Add two methods to
MailchimpCampaignBackend
:save_campaign(campaign_id: str | None, recipients: NewsletterRecipients, subject: str, content: str)
: create or update a campaign. To allow the integration of newsletter providers that don't support updating a campaign, and thus require deleting and recreating it to simulate an update, the method should return the ID of the campaign.send_test_email(campaign_id: str, email_address: str)
: send a test email for the campaign.The
send_test_email
method will expect the following Django settings to be defined:WAGTAIL_NEWSLETTER_FROM_NAME
: name of the email sender.WAGTAIL_NEWSLETTER_REPLY_TO
: email address of the email sender.Here is a sample implementation of creating a campaign and sending a test email with Mailchimp:
In the page editor, on the newsletter tab, when clicking on Send test email, it should display a dialog, asking for an email address, with a Send button. Behind the scenes, this will call the backend to create/update the campaign and to send a test email.