skyhop / Mail

A library smoothing email generation from .NET code, by enforcing a strong boundary between the template, and code rendering the template.
Apache License 2.0
11 stars 2 forks source link

Base model refactor #5

Closed synercoder closed 4 years ago

synercoder commented 4 years ago

Only way to set the To, From, Cc & Bcc are now using the MailDispatcher instead of also setting them in the MimeMessage. This makes the To parameter now required.

And the From parameter is optional, as long is the DefaultFromAddress is set. Otherwise an ArgumentException is thrown.

synercoder commented 4 years ago

That was my (reversed) thinking why I removed the To & CC params from the ViewModel. To have just 1 place where you put them.

corstian commented 4 years ago

Would it be a reasonable separation to set the destination on the SendMail method, while setting the content within the viewmodel?

Trying to keep the cognitive load as low as possible...

synercoder commented 4 years ago

Sounds like a good plan