FluentEmail icon indicating copy to clipboard operation
FluentEmail copied to clipboard

Implement support for mailgun test mode

Open belidzs opened this issue 4 years ago • 4 comments

belidzs avatar May 25 '20 13:05 belidzs

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 avatar Aug 06 '20 21:08 lukencode

@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.

belidzs avatar Aug 06 '20 22:08 belidzs

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.

belidzs avatar Aug 06 '20 22:08 belidzs

Too bad this has bled to death

stefankip avatar Feb 22 '21 13:02 stefankip