Don't create multipart if not necessary#23
Conversation
Add tests Fixes jpoehls#6
main.go
Outdated
There was a problem hiding this comment.
I think we can remove this since we validate at the top that at least a Body or HTMLBody is non-empty.
There was a problem hiding this comment.
You're right, but actually I think it would be better to allow both to be empty, and just create a message with an empty plain text body and no html body.
This would also be backwards compatible.
There was a problem hiding this comment.
You're right, but actually I think it would be better to allow both to be empty, and just create a message with an empty plain text body and no html body.
👍 I'm cool with that.
|
Added a minor line note to check on but otherwise this looks good to me. Tests pass (we have tests finally!) -- Super excited to get this landed. Thanks for working on it! |
|
|
If both bodies are empty, send an empty plain text body.
The test used the multipart reader incorrectly, which broke under go 1.7. When reading a part, the returned `multipart.Part` should be used as the source, not the original buffer.
Fixes #6