wneessen / go-mail

📧 Easy to use, yet comprehensive library for sending mails with Go
https://go-mail.dev
MIT License
571 stars 44 forks source link

Expose Msg fields #60

Closed dhia-gharsallaoui closed 1 year ago

dhia-gharsallaoui commented 1 year ago

Is your feature request related to a problem? Please describe.

In order to use middlewares we need to have access to the Msg fields. For example, in my use case I want to add OpenPGP support so I need to manipulate the parts of Msg.

Describe the solution you'd like

I propose either to make Msg field public. Or add theirs Get and Set methods. WDYT?

Describe alternatives you've considered

No response

Additional context

No response

wneessen commented 1 year ago

100% agreed. I've already instroduced Msg.GetGenHeader() in 0.2.9 to get access to the Msg headers and am currently working on implementing similar getters for the body parts.

dhia-gharsallaoui commented 1 year ago

Is there anyway that I could help you to get it out soon? I will be happy to assist if needed always.

wneessen commented 1 year ago

Thanks for the offer! Appreciated! I'm almost done with the body parts, only the test coverage is missing. Probably done today or tomorrow.

wneessen commented 1 year ago

Hmm, would you need access to the attachments as well? I've left them out for now but if you need them, maybe you want to start working on that? You can check out the https://github.com/wneessen/go-mail/tree/60-expose-msg-fields branch to see what I am currently doing for the body parts