Closed mgax closed 1 week ago
When a newsletter page is ready, and the author has presumably sent a test email to themselves, it should be possible to trigger campaign sending.
Add a method to MailchimpCampaignBackend named send_campaign(campaign_id: str). It should call the Mailchimp client's client.campaigns.send method.
MailchimpCampaignBackend
send_campaign(campaign_id: str)
client.campaigns.send
In the page editor, on the newsletter tab, when the user clicks Send campaign, it should:
save_campaign
send_campaign
If the API calls are successful, the server should redirect to the page editor, where the "Newsletter" tab will show the campaign sending status.
If the API calls return errors, they should be sent as a message (using the wagtail.admin.messages framework).
wagtail.admin.messages
When a newsletter page is ready, and the author has presumably sent a test email to themselves, it should be possible to trigger campaign sending.
Add a method to
MailchimpCampaignBackend
namedsend_campaign(campaign_id: str)
. It should call the Mailchimp client'sclient.campaigns.send
method.In the page editor, on the newsletter tab, when the user clicks Send campaign, it should:
save_campaign
method, so that Mailchimp has the latest content.send_campaign
method, to send the campaign.If the API calls are successful, the server should redirect to the page editor, where the "Newsletter" tab will show the campaign sending status.
If the API calls return errors, they should be sent as a message (using the
wagtail.admin.messages
framework).