Add Cloudflare Email Sending #883
Draft
lylo wants to merge 12 commits into
Draft
Conversation
Implements a custom ActionMailer delivery method backed by the Cloudflare Email Sending API. Enable per blog by adding "cloudflare_email" to the blog's features array via admin. Falls back to MailPace for all other blogs.
Move Cloudflare routing logic out of MailpaceMailer into a concern that individual mailers include. Add it to AccountVerificationMailer for login emails as the initial test case.
Replace the per-blog CloudflareRoutable concern with a proper CloudflareMailer base class, matching the pattern used by PostmarkMailer and MailpaceMailer.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduces Cloudflare Email Sending as an alternative email delivery method, switchable per-blog via a feature flag.
CloudflareEmail::DeliveryMethod) sends mail via the Cloudflare Email Sending API, registered as a standard Action Mailer delivery method in an initializerafter_actiononMailpaceMailerchecks for thecloudflare_emailfeature flag on the blog and swaps the delivery method on the message before it's sent. No flag = default MailPace delivery, so this is a no-op for existing blogsCLOUDFLARE_EMAIL_API_TOKENandCLOUDFLARE_ACCOUNT_IDNotes
fromfield supports both plain addresses and display-name addresses per the Cloudflare API specEmailSubscriptionConfirmationMailernow caches@blogso it's available to theafter_actioncallbackTest plan
cloudflare_emailfeature on a test blog and verify subscription confirmation emails are delivered via Cloudflare