-
Notifications
You must be signed in to change notification settings - Fork 584
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e17b7f3
commit 3f6197a
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -277,6 +277,42 @@ ver groupId = "<UNSUBSCRIBE GROUP ID>"; | |
HttpResponseMessage responseDelete1 = client.Suppressions.Delete(groupId, "[email protected]").Result; | ||
``` | ||
|
||
## Global Suppressions ## | ||
|
||
Please refer to [our documentation](https://sendgrid.com/docs/API_Reference/Web_API_v3/Suppression_Management/global_suppressions.html) for further details. | ||
|
||
Check if a recipient address is in the global suppressions group. [GET] | ||
|
||
```csharp | ||
String apiKey = Environment.GetEnvironmentVariable("SENDGRID_APIKEY", EnvironmentVariableTarget.User); | ||
var client = new SendGrid.Client(apiKey); | ||
// Leave off .Result for an asyncronous call | ||
string email = "[email protected]"; | ||
HttpResponseMessage responseGet = client.GlobalSuppressions.Get(email).Result; | ||
``` | ||
|
||
Add recipient addresses to the global suppression group. [POST] | ||
|
||
If the group has been deleted, this request will add the address to the global suppression. | ||
|
||
```csharp | ||
String apiKey = Environment.GetEnvironmentVariable("SENDGRID_APIKEY", EnvironmentVariableTarget.User); | ||
var client = new SendGrid.Client(apiKey); | ||
string[] emails = { "[email protected]", "[email protected]" }; | ||
// Leave off .Result for an asyncronous call | ||
HttpResponseMessage responsePost = client.GlobalSuppressions.Post(emails).Result; | ||
``` | ||
|
||
Delete a recipient email from the global suppressions group. [DELETE] | ||
|
||
```csharp | ||
String apiKey = Environment.GetEnvironmentVariable("SENDGRID_APIKEY", EnvironmentVariableTarget.User); | ||
var client = new SendGrid.Client(apiKey); | ||
string email = "[email protected]"; | ||
// Leave off .Result for an asyncronous call | ||
HttpResponseMessage responseDelete1 = client.GlobalSuppressions.Delete(email).Result; | ||
``` | ||
|
||
#How to: Testing | ||
|
||
* Load the solution (We have tested using the Visual Studio Community Edition) | ||
|