wagtail / wagtail-newsletter

Send email newsletters based on Wagtail content
https://wagtail-newsletter.readthedocs.io
BSD 3-Clause "New" or "Revised" License
9 stars 3 forks source link

Send campaign immediately #24

Closed mgax closed 1 week ago

mgax commented 1 month 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.

In the page editor, on the newsletter tab, when the user clicks Send campaign, it should:

  1. Call the campaign backend's save_campaign method, so that Mailchimp has the latest content.
  2. Call the campaign backend's 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).