FluentEmail
FluentEmail copied to clipboard
Implement support for mailgun test mode
Hi @belidzs thanks for the PR. Do you think this functionality is better implemented when setting up the MailGun sender eg:
var sender = new MailgunSender(
"sandboxcf5f41bbf2f84f15a386c60e253b5fe9.mailgun.org", // Mailgun Domain
"key-8d32c046d7f14ada8d5ba8253e3e30de" // Mailgun API Key
//set test mode here
);
@lukencode if there's no test mode implemented by other (supported) e-mail providers then absolutely, this functionality should be mailgun-exclusive and go to the MailgunSender
class.
To be honest I don't have much experience with other providers so I'm not sure if that's the case or not.
After a quick search I've found that SendGrid also provides a test mode, so it seems like it's a pretty common thing.
However I'm still not sure whether setting test mode should be the job of the ISender
or the IFluentEmail
descendants.
When dealing with SendGrid or mailgun directly you set test mode on a per message basis (either in a special e-mail header or as a JSON property). This tells me that test mode should be a property of IFluentEmail
but since this is definitely a grey area I think you should decide.
Too bad this has bled to death