Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sink server/test mode #132

Open
asherber opened this issue Jan 19, 2017 · 3 comments
Open

Sink server/test mode #132

asherber opened this issue Jan 19, 2017 · 3 comments

Comments

@asherber
Copy link
Contributor

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.

@darrencauthon
Copy link
Owner

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
Copy link
Owner

darrencauthon commented Jan 19, 2017

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.

@asherber
Copy link
Contributor Author

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!).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants