From 5138f21df75026c24ee327b1fc043a16c5231ecf Mon Sep 17 00:00:00 2001 From: sburman Date: Fri, 24 Nov 2023 23:47:17 +0530 Subject: [PATCH] comments --- USE_CASES.md | 24 ++++++++++++++++++++++++ src/SendGrid/SendGridClientOptions.cs | 3 +++ 2 files changed, 27 insertions(+) diff --git a/USE_CASES.md b/USE_CASES.md index 63dd80c84..271374842 100644 --- a/USE_CASES.md +++ b/USE_CASES.md @@ -920,6 +920,30 @@ var client = new SendGridClient(options); ``` +The SendGridClientOptions object can also be used to set the region to "eu", which will send the +request to https://api.eu.sendgrid.com/. By default it is set to https://api.sendgrid.com/, e.g. + +```csharp + +var options = new SendGridClientOptions +{ + ApiKey = Environment.GetEnvironmentVariable("NAME_OF_THE_ENVIRONMENT_VARIABLE_FOR_YOUR_SENDGRID_KEY"), + ReliabilitySettings = new ReliabilitySettings(2, TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(3)), + Host = "Your-Host", + UrlPath = "Url-Path", + Version = "3", + RequestHeaders = new Dictionary() {{"header-key", "header-value"}} +}; +options.SetDataResidency("eu"); +var client = new SendGridClient(options); + +OR + +options.SetDataResidency("global"); +var client = new SendGridClient(options); + +``` + # How to Setup a Domain Authentication diff --git a/src/SendGrid/SendGridClientOptions.cs b/src/SendGrid/SendGridClientOptions.cs index 3cfb2986f..f46d7c9d0 100644 --- a/src/SendGrid/SendGridClientOptions.cs +++ b/src/SendGrid/SendGridClientOptions.cs @@ -48,6 +48,9 @@ public string ApiKey /// Sets the data residency for the SendGrid client. /// /// The desired data residency region ("global" or "eu"). + /// Global is the default residency (or region) + /// Global region means the message will be sent through https://api.sendgrid.com + /// EU region means the message will be sent through https://api.eu.sendgrid.com /// The updated SendGridClientOptions instance. public SendGridClientOptions SetDataResidency(string region) {