summaryrefslogtreecommitdiffstats
path: root/SendGrid/Example/Example.cs
diff options
context:
space:
mode:
Diffstat (limited to 'SendGrid/Example/Example.cs')
-rw-r--r--SendGrid/Example/Example.cs10
1 files changed, 4 insertions, 6 deletions
diff --git a/SendGrid/Example/Example.cs b/SendGrid/Example/Example.cs
index 35c209b..8360a1b 100644
--- a/SendGrid/Example/Example.cs
+++ b/SendGrid/Example/Example.cs
@@ -31,9 +31,7 @@ namespace Example
{
String apiKey = Environment.GetEnvironmentVariable("SENDGRID_APIKEY",
EnvironmentVariableTarget.User);
- SendGridAPIClient sg = new SendGridAPIClient(apiKey: apiKey,
- baseUri: "https://api.sendgrid.com",
- urlPath: "mail/send");
+ Client client = new Client(apiKey: apiKey);
Email from = new Email("dx@sendgrid.com");
String subject = "I'm replacing the subject tag";
@@ -46,9 +44,9 @@ namespace Example
mail.Personalization[0].AddSubstitution("-city-", "Denver");
Console.WriteLine(mail.Get());
- Response response = await sg.Client.RequestAsync(method: SendGridAPIClient.Methods.POST,
- requestBody: mail.Get(),
- urlPath: "mail/send");
+ Response response = await client.RequestAsync(method: SendGridAPIClient.Methods.POST,
+ requestBody: mail.Get(),
+ urlPath: "mail/send");
Console.WriteLine(response.StatusCode);
Console.WriteLine(response.Body.ReadAsStringAsync().Result);
Console.WriteLine(response.Headers.ToString());