feature: Move MIME support out of internal
jason-jackson opened this issue · 3 comments
Description
Currently MIME support is through mail/internal/mail/message.go
, an internal package. So if I wanted to create my own Sender/BatchSender implementation with MIME support, I would need to duplicate code. Options I see:
- Add a function to mail.Message to convert it to []byte with MIME data
- Add a function to mail package that takes in a mail.Message and converts it to []byte with MIME data
Thanks!
Additional Information
No response
I'm completely fine with exposing it as a writer instead of []byte, just would be nice to have available without having to copy/paste from smtp. Had []byte as working with ses, which takes in a byte slice.
I did not take a look into your issue in detail, but just want to tell you the following things around the package:
- If there is no BIG reason, the package
mail/internal/mail
or part of them will not pop out from the internal- The package is actually a kind of vendorized module into Buffalo core but not a part of it
- It can be removed anytime when we don't need them anymore or find another way to use them
- Originally, the package came from
- https://github.com/go-mail/mail, which is a popular fork of
- the originally https://github.com/go-gomail/gomail
- it seems like https://github.com/Shopify/gomail is the most actively maintained fork nowadays
with this context, I can tell we will not expose anything from the internal mail package but we may be able to expand Buffalo's mail
package. If your issue is about extending Buffalo's mail
, please explain more about the purpose, use case, direction, or anything you think. However, if your issue is something directly related to the internal mail
package, I think checking the modules above or the other modules for MIME support could be better.
I am closing it for now, but please feel free to reopen it if you think my answer does not help you and we need more discussion on this topic.