Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
shrutiburman committed Nov 24, 2023
1 parent a84cf9e commit 5138f21
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
24 changes: 24 additions & 0 deletions USE_CASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, string>() {{"header-key", "header-value"}}
};
options.SetDataResidency("eu");
var client = new SendGridClient(options);

OR

options.SetDataResidency("global");
var client = new SendGridClient(options);

```

<a name="domain-authentication"></a>
# How to Setup a Domain Authentication

Expand Down
3 changes: 3 additions & 0 deletions src/SendGrid/SendGridClientOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ public string ApiKey
/// Sets the data residency for the SendGrid client.
/// </summary>
/// <param name="region">The desired data residency region ("global" or "eu").</param>
/// 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
/// <returns>The updated SendGridClientOptions instance.</returns>
public SendGridClientOptions SetDataResidency(string region)
{
Expand Down

0 comments on commit 5138f21

Please sign in to comment.