Skip to content

Commit 721f5ae

Browse files
Added Troubleshooting section
1 parent 03807ce commit 721f5ae

File tree

2 files changed

+85
-1
lines changed

2 files changed

+85
-1
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
**This library allows you to quickly and easily use the SendGrid Web API v3 via C# with .NET.**
44

5-
Version 7.X.X of this library provides full support for all SendGrid [Web API v3](https://sendgrid.com/docs/API_Reference/Web_API_v3/index.html) endpoints, including the new [v3 /mail/send](https://sendgrid.com/blog/introducing-v3mailsend-sendgrids-new-mail-endpoint).
5+
Version 7.X.X+ of this library provides full support for all SendGrid [Web API v3](https://sendgrid.com/docs/API_Reference/Web_API_v3/index.html) endpoints, including the new [v3 /mail/send](https://sendgrid.com/blog/introducing-v3mailsend-sendgrids-new-mail-endpoint).
66

77
This library represents the beginning of a new path for SendGrid. We want this library to be community driven and SendGrid led. We need your help to realize this goal. To help make sure we are building the right things in the right order, we ask that you create [issues](https://github.com/sendgrid/sendgrid-csharp/issues) and [pull requests](https://github.com/sendgrid/sendgrid-csharp/blob/master/CONTRIBUTING.md) or simply upvote or comment on existing issues or pull requests.
88

@@ -218,6 +218,10 @@ Quick links:
218218
- [Sign the CLA to Create a Pull Request](https://github.com/sendgrid/sendgrid-csharp/tree/master/CONTRIBUTING.md#cla)
219219
- [Improvements to the Codebase](https://github.com/sendgrid/sendgrid-csharp/tree/master/CONTRIBUTING.md#improvements_to_the_codebase)
220220

221+
# Troubleshooting
222+
223+
Please see our [troubleshooting guide](https://github.com/sendgrid/sendgrid-csharp/blob/master/TROUBLESHOOTING.md) for common library issues.
224+
221225
# About
222226

223227
sendgrid-csharp is guided and supported by the SendGrid [Developer Experience Team](mailto:[email protected]).

TROUBLESHOOTING.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
If you have a non-library SendGrid issue, please contact our [support team](https://support.sendgrid.com).
2+
3+
If you can't find a solution below, please open an [issue](https://github.com/sendgrid/sendgrid-csharp/issues).
4+
5+
6+
## Table of Contents
7+
8+
* [Migrating from v2 to v3](#migrating)
9+
* [Continue Using v2](#v2)
10+
* [Testing v3 /mail/send Calls Directly](#testing)
11+
* [Error Messages](#error)
12+
* [Versions](#versions)
13+
* [Environment Variables and Your SendGrid API Key](#environment)
14+
* [Using the Package Manager](#package-manager)
15+
16+
<a name="migrating"></a>
17+
## Migrating from v2 to v3
18+
19+
Please review [our guide](https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/how_to_migrate_from_v2_to_v3_mail_send.html) on how to migrate from v2 to v3.
20+
21+
<a name="v2"></a>
22+
## Continue Using v2
23+
24+
[Here](https://github.com/sendgrid/sendgrid-csharp/tree/b27983a8f3d84a9d28972f2720cca0315ad9fe32) is the last working version with v2 support.
25+
26+
Using Nuget:
27+
28+
```bash
29+
PM> Install-Package Sendgrid -Version 6.3.4
30+
```
31+
32+
Download:
33+
34+
Click the "Clone or download" green button in [GitHub](https://github.com/sendgrid/sendgrid-csharp/tree/b27983a8f3d84a9d28972f2720cca0315ad9fe32) and choose download.
35+
36+
<a name="testing"></a>
37+
## Testing v3 /mail/send Calls Directly
38+
39+
[Here](https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/curl_examples.html) are some cURL examples for common use cases.
40+
41+
<a name="error"></a>
42+
## Error Messages
43+
44+
To read the error message returned by SendGrid's API:
45+
46+
```csharp
47+
dynamic response = await sg.client.mail.send.post(requestBody: mail.Get());
48+
Console.WriteLine(response.StatusCode);
49+
Console.WriteLine(response.Body.ReadAsStringAsync().Result);
50+
Console.WriteLine(response.Headers.ToString());
51+
```
52+
53+
<a name="versions"></a>
54+
## Versions
55+
56+
We follow the MAJOR.MINOR.PATCH versioning scheme as described by [SemVer.org](http://semver.org). Therefore, we recommend that you always pin (or vendor) the particular version you are working with to your code and never auto-update to the latest version. Especially when there is a MAJOR point release, since that is guarenteed to be a breaking change. Changes are documented in the [CHANGELOG](https://github.com/sendgrid/sendgrid-csharp/blob/master/CHANGELOG.md) and [releases](https://github.com/sendgrid/sendgrid-csharp/releases) section.
57+
58+
<a name="environment"></a>
59+
## Environment Variables and Your SendGrid API Key
60+
61+
All of our examples assume you are using [environment variables](https://github.com/sendgrid/sendgrid-csharp#setup-environment-variables) to hold your SendGrid API key.
62+
63+
If you choose to add your SendGrid API key directly (not recommended):
64+
65+
`string apiKey = Environment.GetEnvironmentVariable("SENDGRID_API_KEY", EnvironmentVariableTarget.User);`
66+
67+
becomes
68+
69+
`string apiKey = "SENDGRID_API_KEY";`
70+
71+
In the first case SENDGRID_API_KEY is in reference to the name of the environment variable, while the second case references the actual SendGrid API Key.
72+
73+
<a name="package-manager"></a>
74+
## Using the Package Manager
75+
76+
We upload this library to [Nuget](https://www.nuget.org/packages/SendGrid) whenever we make a release. This allows you to use [Nuget](https://www.nuget.org) for easy installation.
77+
78+
In most cases we recommend you download the latest version of the library, but if you need a different version, please use:
79+
80+
`PM> Install-Package Sendgrid -Version X.X.X`

0 commit comments

Comments
 (0)