Repository navigation
feat(mail): send headers, a plain text part and an ses configuration set - #2
Merged
Merged
Conversation
Bulk mail needs a List-Unsubscribe header and a text part, and marketing mail needs its own SES configuration set so its bounces and complaints are reported apart from transactional mail. Envelope gains Headers and ConfigurationSet, merged over the default envelope; Content gains an optional TextView. SES sends all three; SMTP sends the headers, the configuration set as X-SES-CONFIGURATION-SET, and the text with the HTML as its alternative.
Tests live in tests/, mirroring the code. The test now sends through Adapter.Send against a local server standing in for SES (AWS_ENDPOINT_URL_SESV2), so it reads what is actually sent.
Split the SMTP adapter's headers and body out of Send, preallocate the SES headers but send none when there are none, and wrap a long line in the SES test.
A mail's header now takes the place of a default one of the same name, whatever its case, instead of going out twice. CheckHeaders refuses reserved names (From, To, Bcc and the like, which over SMTP would change who gets the mail), names SES would not take, and values with a line break; both adapters check before sending. TextView moves after With so unkeyed Content literals keep compiling, and SendCall keeps its fields' order. The SMTP adapter gets tests against a local server, and the merge test now has a default with room to spare, so it fails if a merge leaks into the next mail.
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.
Bulk mail needs a
List-Unsubscribeheader and a plain text part, and marketing mail needs its own SES configuration set, so its bounces and complaints are reported apart from transactional mail.Envelope.HeadersandEnvelope.ConfigurationSet, merged over the default envelope: headers append, the configuration set overrides.Content.TextView, optional, rendered with the sameWith. Without it a mail is HTML alone, as before.Message.Headers), the text body andConfigurationSetName. Message building moved intobuildMessageso it can be tested.X-SES-CONFIGURATION-SET(which SES's SMTP interface reads), and sends text with the HTML as its alternative.