csharp-sparkpost icon indicating copy to clipboard operation
csharp-sparkpost copied to clipboard

Sink server/test mode

Open asherber opened this issue 8 years ago • 3 comments

https://support.sparkpost.com/customer/en/portal/articles/2560839-how-do-i-test-using-the-sink-server-on-sparkpost-?b_id=7411

It would be nice for the library to have some support around this. The simplest option, which is how some other ESPs manage it, would be to have a TestMode flag in Transmission.Options. If this flag is on, the library would append .sink.sparkpostmail.com to each recipient email address before sending.

I know you like to have the library mirror the actual structure of the API and may not like to add an option that doesn't correspond to an actual API flag, so another option would be to add a Transmission.Recipients.Sinkify() method that massages the addresses.

I'm happy to do the work on this, if you could weigh in on an approach.

asherber avatar Jan 19 '17 03:01 asherber

Ahh, I didn't know about this... that's a great idea!

Hmm.... I like your idea. Part of me thinks we might want to carry this sink option from the client level all of the way down to the individual recipient.

So I could use them like this:

var client = new Client("xyz", new { SinkTransmissions = true});
// OR
client.Transmissions.Options.SinkTransmissions = true;
// OR
var transmission = new Transmission(); // yadda yadda yadda
var recipient = new Recipient() { Sink = true };
transmission.Add(recipient);

darrencauthon avatar Jan 19 '17 17:01 darrencauthon

Just thinking aloud... I think it would be better to make this library work with the same verbiage as SparkPost. So I know this feature is for testing, but they call it "sink" so we should call it that as well.

darrencauthon avatar Jan 19 '17 17:01 darrencauthon

I'm fine with using the "Sink" terminology.

As a user, I think having this just on an individual Transmission is what I would expect. My second choice would be to have it on the client, probably as client.Transmissions.UseSink = true.

I would suggest not having this available at different levels of the hierarchy – it would be confusing to figure out how they interact (both on the dev side and the user side!).

asherber avatar Jan 19 '17 17:01 asherber