Handle Message With Empty Multipart Content - #54
Open
tres wants to merge 2 commits into
Open
Conversation
Actionmailer is happy to have an empty text or html part to a multipart
message. This makes Sendgrid unhappy. Sendgrid will return an error when
attempting to send a message where a specific part of a multipart
message is empty.
This update allows for the behavior of actionmailer to coexist with the
requirements of the Sendgrid API.
##
_[]_
[____]
.----' '----.
.===| .==. |===.
\ | /####\ | /
/ | \####/ | \
'===| `""` |==='
.===| .==. |===.
\ | /::::\ | /
/ | \::::/ | \
'===| `""` |==='
.===| .==. |===.
\ | /&&&&\ | /
/ | \&&&&/ | \
'===| `""` |==='
jgs '--.______.--'
This update removes angle brackets from an inline attachment's content
ID. As provided by actionmailer, there are angle brackets & Sengrid
wants to add their own angle brackets, which breaks the display of
inline attachments in the email.
_____ _______
,/_ ``-._ / \
,|: `'-..__ ___| |_
,|:_ ``'''-----''''`_::~-.......-'~\
,|:_ _: . ' . :
|:_ _: . ' . |
|:_ _: ' . ' |
|:_ _: ' . ' :
|:_ __,,...---...,,:_,.-'''''-.,_/
|:_ _,.-`` | |
|:_ ,-` | |
|:_ ,` | |
`|:_ ,' | |
|:_ / | |
`|:_ / | |
`|:_ : | |
\: | | |
\:| | |
~
norse viking axe
cjr4may99
Collaborator
|
@tres, present? isn't available on Mail::Body, but the following should work: We should also probably add a test to confirm this functions as expected. |
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.
Actionmailer is happy to have an empty text or html part to a multipart
message. This makes Sendgrid unhappy. Sendgrid will return an error when
attempting to send a message where a specific part of a multipart
message is empty.
This update allows for the behavior of actionmailer to coexist with the
requirements of the Sendgrid API.
jgs '--.______.--'