Kitura / Swift-SMTP

Swift SMTP client
Apache License 2.0
259 stars 60 forks source link

Why are almost all `Mail`-properties internal? #54

Closed Obbut closed 6 years ago

Obbut commented 6 years ago

I'm moving an application from the broken Vapor SMTP implementation to this one, and have noticed that almost all properties on a Mail are internal.

E-mails are sent from various places in the application, and we centrally log all sent e-mails into the database. Is there a specific reason why the properties (like from, to, subject and text) are internal?

quanvo87 commented 6 years ago

I think it was to keep the public API as simple as possible. Presumably if the user created a Mail struct and supplied properties like from, to, etc., then they could retrieve those values again from wherever they originally came from, without having to refer to the Mail struct.

But if there was a good reason to expose those properties than I would happily apply a fix.

Obbut commented 6 years ago

I've worked around it by using my own struct for now, so for me it's not really a huge issue. If more people log their e-mails like we do, it may be a good idea to expose them.

quanvo87 commented 6 years ago

Sure, we can expose those properties. I'll apply the fix with the next release, pending any changes that happen as a result of #55.

quanvo87 commented 6 years ago

Fixed in https://github.com/IBM-Swift/Swift-SMTP/releases/tag/v3.0.0