serilog / serilog-sinks-email

A Serilog sink that writes events to SMTP email
Apache License 2.0
76 stars 69 forks source link

Extract e-mail transport from sink #98

Closed mgrosperrin closed 3 years ago

mgrosperrin commented 3 years ago

I have introduced two abstractions:

I modified the EmailConnectionInfo to add a internal virtual CreateEmailTransport method to create the IEmailTransport the sink should use. This will allow unit testing the sink without the transport.

There is now only one sink and two implementations of the transport.

Regarding PRs #51 and #54, I think it will be simpler to merge this one first and update the others PRs .

fixes #27

PS: I also fix a typo when splitting the To addresses... PPS: this replaces the PR #55

mgrosperrin commented 3 years ago

I introduce, on the tests project, a new xUnit.Net attribute (UseCultureAttribute) to set the culture for the tests and a new constant (NEW_ARGUMENTOUTOFRANGEEXCEPTION_MESSAGE) to handle change of message for exception message in .NET Core 3.1

nblumhardt commented 3 years ago

Awesome, thanks @mgrosperrin!

Made a note regarding the origin of UseCultureAttribute, since it's third-party code.

On its way through CI to a NuGet dev package now 😎

mgrosperrin commented 3 years ago

Awesome, thanks @mgrosperrin!

Made a note regarding the origin of UseCultureAttribute, since it's third-party code.

On its way through CI to a NuGet dev package now 😎

Hi, Thanks for the note, the attribute is my codebox but I forgot to add the origin 😔.