summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md17
-rw-r--r--CONTRIBUTING.md90
-rw-r--r--LICENSE.txt2
-rw-r--r--README.md78
-rw-r--r--USAGE.md94
5 files changed, 89 insertions, 192 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6fb4af8..257d958 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,36 +8,36 @@ All notable changes to this project will be documented in this file.
- v3 Mail Send helper
## [6.3.4] - 2015-12-15
-###Added
+### Added
- Implemented the global stats /asm/stats endpoint [GET]
## [6.3.3] - 2015-12-14
-###Added
+### Added
- Implemented the global suppressions /asm/suppressions/global endpoint [GET, POST, DELETE]
## [6.3.2] - 2015-12-11
-###Added
+### Added
- Implemented the suppressions /asm/groups/:group_id/suppressions endpoint [GET, POST, DELETE]
## [6.3.1] - 2015-12-10
-###Added
+### Added
- Implemented the unsubscribe groups /asm/groups endpoint [GET, POST, DELETE]
## [6.3.0] - 2015-11-24
-###Added
+### Added
- Send emails using API Key
## [6.2.0] - 2015-11-18
-###Added
+### Added
- Added support for using the Web API v3 endpoints
- Implemented the api_keys endpoint [GET, POST, PATCH, DELETE]
## [6.1.0] - 2015-4-27
-###Added
+### Added
- Added support for sending via API keys in addition to credentials. Pass an API Key string to the Web transport constructor
## [6.0.1] - 2015-4-24
-###Fixed
+### Fixed
- Fixed the endpoint URL. (⌒_⌒;)
## [6.0.0] - 2015-4-22
@@ -62,7 +62,6 @@ Deliver method. All other changes are backwards compatible.
### Fixed
- Invalid Protocol Exception in Mono due to the way the endpoint URL was
being assigned (thanks @mdymel, @rbarinov)
-
- Connections were not being reused. This was causing degraded
performance with multiple threads open. Performance should be much
better. (with help from @gatesvp)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 3877c27..e11899f 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,14 +1,28 @@
-Hello! Thank you for choosing to help contribute to the sendgrid-csharp library. There are many ways you can contribute and help is always welcome.
-
+Hello! Thank you for choosing to help contribute to one of the SendGrid open source libraries. There are many ways you can contribute and help is always welcome. We simply ask that you follow the following contribution policies.
+
+- [CLAs and CCLAs](#cla)
+- [Roadmap & Milestones](#roadmap)
+- [Feature Request](#feature_request)
+- [Submit a Bug Report](#submit_a_bug_report)
+- [Improvements to the Codebase](#improvements_to_the_codebase)
+- [Understanding the Code Base](#understanding_the_codebase)
+- [Testing](#testing)
+- [Style Guidelines & Naming Conventions](#style_guidelines_and_naming_conventions)
+- [Creating a Pull Request](#creating_a_pull_request)
+
+<a name="roadmap"></a>
We use [Milestones](https://github.com/sendgrid/sendgrid-csharp/milestones) to help define current roadmaps, please feel free to grab an issue from the current milestone. Please indicate that you have begun work on it to avoid collisions. Once a PR is made, community review, comments, suggestions and additional PRs are welcomed and encouraged.
-* [Feature Request](#feature_request)
-* [Submit a Bug Report](#submit_a_bug_report)
-* [Improvements to the Codebase](#improvements_to_the_codebase)
-* [Understanding the Code Base](#understanding_the_codebase)
-* [Testing](#testing)
-* [Style Guidelines & Naming Conventions](#style_guidelines_and_naming_conventions)
-* [Creating a Pull Request](#creating_a_pull_request)
+<a name="cla"></a>
+## CLAs and CCLAs
+
+Before you get started, SendGrid requires that a SendGrid Contributor License Agreement (CLA) or a SendGrid Company Contributor Licensing Agreement (CCLA) be filled out by every contributor to a SendGrid open source project.
+
+Our goal with the CLA and CCLA is to clarify the rights of our contributors and reduce other risks arising from inappropriate contributions. The CLA also clarifies the rights SendGrid holds in each contribution and helps to avoid misunderstandings over what rights each contributor is required to grant to SendGrid when making a contribution. In this way the CLA and CCLA encourage broad participation by our open source community and help us build strong open source projects, free from any individual contributor withholding or revoking rights to any contribution.
+
+SendGrid does not merge a pull request made against a SendGrid open source project until that pull request is associated with a signed CLA (or CCLA). Copies of the CLA and CCLA are available [here](https://drive.google.com/a/sendgrid.com/file/d/0B0PlcM9qA91LN2VEUTJWU2RIVXc/view).
+
+You may submit your completed [CLA or CCLA](https://drive.google.com/a/sendgrid.com/file/d/0B0PlcM9qA91LN2VEUTJWU2RIVXc/view) to SendGrid at [dx@sendgrid.com](mailto:dx@sendgrid.com). SendGrid will then confirm you are ready to begin making contributions.
There are a few ways to contribute, which we'll enumerate below:
@@ -37,29 +51,7 @@ Before you decide to create a new issue, please try the following:
### Please use our Bug Report Template
-In order to make the process easier, we've included a sample bug report template (borrowed from [Ghost](https://github.com/TryGhost/Ghost/)). The template uses [GitHub flavored markdown](https://help.github.com/articles/github-flavored-markdown/) for formatting.
-
-```
-Short and descriptive example bug report title
-
-#### Issue Summary
-
-A summary of the issue and the environment in which it occurs. If suitable, include the steps required to reproduce the bug. Please feel free to include screenshots, screencasts, code examples.
-
-
-#### Steps to Reproduce
-
-1. This is the first step
-2. This is the second step
-3. Further steps, etc.
-
-Any other information you want to share that is relevant to the issue being reported. Especially, why do you consider this to be a bug? What do you expect to happen instead?
-
-#### Technical details:
-
-* sendgrid-charp Version: master (latest commit: 2cb34372ef0f31352f7c90015a45e1200cb849da)
-* .NET Version: 4.5.2
-```
+In order to make the process easier, we've included a [sample bug report template](https://github.com/sendgrid/sendgrid-csharp/.github/ISSUE_TEMPLATE) (borrowed from [Ghost](https://github.com/TryGhost/Ghost/)). The template uses [GitHub flavored markdown](https://help.github.com/articles/github-flavored-markdown/) for formatting.
<a name="improvements_to_the_codebase"></a>
## Improvements to the Codebase
@@ -68,25 +60,31 @@ We welcome direct contributions to the sendgrid-csharp code base. Thank you!
### Development Environment ###
-#### Install and run locally ####
+#### Install and Run Locally ####
##### Prerequisites #####
-* .NET 4.5.2
-* SendGrid.CSharp.HTTP.Client
-* Newtonsoft.Json
+- .NET 4.5.2
+- [SendGrid.CSharp.HTTP.Client](https://www.nuget.org/packages/SendGrid.CSharp.HTTP.Client/)
+- [Newtonsoft.Json](http://www.newtonsoft.com/json)
##### Initial setup: #####
-```
+```bash
git clone https://github.com/sendgrid/sendgrid-csharp.git
```
Open `sendgrid-csharp/SendGrid/SendGrid.sln`
+## Environment Variables
+
+First, get your free SendGrid account [here](https://sendgrid.com/free?source=sendgrid-csharp).
+
+Next, update your Environment (user space) with your [SENDGRID_API_KEY](https://app.sendgrid.com/settings/api_keys).
+
##### Execute: #####
-See the [Example project]() to get started quickly.
+See the [examples folder](https://github.com/sendgrid/sendgrid-csharp/tree/v3beta/SendGrid/Example) to get started quickly.
<a name="understanding_the_codebase"></a>
## Understanding the Code Base
@@ -99,20 +97,20 @@ Working examples that demonstrate usage.
The main interface to the SendGrid API is the class `SendGridAPIClient`.
+**/UnitTest**
+
+Unit tests
+
<a name="testing"></a>
## Testing
All PRs require passing tests before the PR will be reviewed.
-All test files are in the [`UnitTest`](https://github.com/sendgrid/sendgrid-csharp/tree/master/UnitTest) directory.
-
-For the purposes of contributing to this repo, please update the [`UnitTest.cs`](https://github.com/sendgrid/sendgrid-sharp/blob/master/UnitTest/UnitTest.cs) file with unit tests as you modify the code.
-
-Within the Test Explorer, click on the "Run All" link.
+All test files are in the [`UnitTest`](https://github.com/sendgrid/sendgrid-csharp/tree/v3beta/SendGrid/UnitTest) directory.
-### Execute: ###
+For the purposes of contributing to this repo, please update the [`UnitTest.cs`](https://github.com/sendgrid/sendgrid-csharp/tree/v3beta/test/SendGrid/UnitTest/UnitTest.cs) file with unit tests as you modify the code.
-Click on the Example project, then click the `Start` button in the menu.
+<!--- describe how to run the tests --->
<a name="style_guidelines_and_naming_conventions"></a>
## Style Guidelines & Naming Conventions
@@ -128,7 +126,7 @@ Generally, we follow the style guidelines as suggested by the official language.
# Clone your fork of the repo into the current directory
git clone https://github.com/sendgrid/sendgrid-csharp
# Navigate to the newly cloned directory
- cd sendgrid-csharp
+ cd sendgrid-python
# Assign the original repo to a remote called "upstream"
git remote add upstream https://github.com/sendgrid/sendgrid-csharp
```
diff --git a/LICENSE.txt b/LICENSE.txt
index a5e93d2..7f9d537 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -1,6 +1,6 @@
The MIT License (MIT)
-Copyright (c) 2016 SendGrid
+Copyright (c) 2012-2016 SendGrid, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/README.md b/README.md
index 5dba9bb..73523d7 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,9 @@
-[![BuildStatus](https://travis-ci.org/sendgrid/sendgrid-csharp.png?branch=v3beta)](https://travis-ci.org/sendgrid/sendgrid-csharp)
+[![BuildStatus](https://travis-ci.org/sendgrid/sendgrid-csharp.png?branch=v3beta)](https://travis-ci.org/sendgrid/sendgrid-csharp
**This library allows you to quickly and easily use the SendGrid Web API via C Sharp with .NET.**
+# Announcements
+
**NOTE: The `/mail/send/beta` endpoint is currently in beta!
Since this is not a general release, we do not recommend POSTing production level traffic through this endpoint or integrating your production servers with this endpoint.
@@ -10,6 +12,24 @@ When this endpoint is ready for general release, your code will require an updat
By using this endpoint, you accept that you may encounter bugs and that the endpoint may be taken down for maintenance at any time. We cannot guarantee the continued availability of this beta endpoint. We hope that you like this new endpoint and we appreciate any [feedback](dx+mail-beta@sendgrid.com) that you can send our way.**
+**BREAKING CHANGE as of XXXX.XX.XX**
+
+Version `7.0.0` is a breaking change for the entire library.
+
+Version 7.0.0 brings you full support for all Web API v3 endpoints. We
+have the following resources to get you started quickly:
+
+- [SendGrid
+ Documentation](https://sendgrid.com/docs/API_Reference/Web_API_v3/index.html)
+- [Usage
+ Documentation](https://github.com/sendgrid/sendgrid-csharp/tree/v3beta/USAGE.md)
+- [Example
+ Code](https://github.com/sendgrid/sendgrid-csharp/tree/v3beta/Example)
+
+Thank you for your continued support!
+
+All updates to this library is documented in our [CHANGELOG](https://github.com/sendgrid/sendgrid-csharp/blob/v3beta/CHANGELOG.md).
+
# Installation
## Environment Variables
@@ -44,7 +64,7 @@ PM> Install-Package SendGrid
```
Once you have the SendGrid libraries properly referenced in your project, you can include calls to them in your code.
-For a sample implementation, check the [Example](https://github.com/sendgrid/sendgrid-csharp/tree/master/SendGrid/Example) folder.
+For a sample implementation, check the [Example](https://github.com/sendgrid/sendgrid-csharp/tree/v3beta/SendGrid/Example) folder.
Add the following namespaces to use the library:
```csharp
@@ -55,14 +75,9 @@ using SendGrid;
## Dependencies
+- The SendGrid Service, starting at the [free level](https://sendgrid.com/free?source=sendgrid-csharp))
- [SendGrid.CSharp.HTTP.Client](https://github.com/sendgrid/csharp-http-client)
-## Environment Variables
-
-First, get your free SendGrid account [here](https://sendgrid.com/free?source=sendgrid-csharp).
-
-Next, update your environment with your [SENDGRID_API_KEY](https://app.sendgrid.com/settings/api_keys).
-
# Quick Start
## Hello Email
@@ -112,53 +127,32 @@ namespace Example
}
```
-# Announcements
-
-**BREAKING CHANGE as of XXXX.XX.XX**
-
-Version `7.0.0` is a breaking change for the entire library.
-
-Version 7.0.0 brings you full support for all Web API v3 endpoints. We
-have the following resources to get you started quickly:
-
-- [SendGrid
- Documentation](https://sendgrid.com/docs/API_Reference/Web_API_v3/index.html)
-- [Usage
- Documentation](https://github.com/sendgrid/sendgrid-csharp/blob/master/USAGE.md)
-- [Example
- Code](https://github.com/sendgrid/sendgrid-csharp/blob/master/Example)
+# Usage
-Thank you for your continued support!
+- [SendGrid Docs](https://sendgrid.com/docs/API_Reference/Web_API_v3/index.html)
+- [Example Code](https://github.com/sendgrid/sendgrid-csharp/tree/v3beta/SendGrid/Example)
+- [v3 Web API Mail Send Helper](https://github.com/sendgrid/sendgrid-csharp/tree/v3beta/SendGrid/SendGrid/Helpers/Mail)
## Roadmap
-[Milestones](https://github.com/sendgrid/sendgrid-csharp/milestones)
+If you are intersted in the future direction of this project, please take a look at our [milestones](https://github.com/sendgrid/sendgrid-csharp/milestones). We would love to hear your feedback.
## How to Contribute
-We encourage contribution to our libraries, please see our [CONTRIBUTING](https://github.com/sendgrid/sendgrid-csharp/blob/master/CONTRIBUTING.md) guide for details.
-
-* [Feature Request](https://github.com/sendgrid/sendgrid-csharp/tree/v3beta/CONTRIBUTING.md#feature_request)
-* [Bug Reports](https://github.com/sendgrid/sendgrid-csharp/tree/v3beta/CONTRIBUTING.md#submit_a_bug_report)
-* [Improvements to the Codebase](https://github.com/sendgrid/sendgrid-csharp/tree/v3beta/CONTRIBUTING.md#improvements_to_the_codebase)
-
-## Usage
-
-- [SendGrid Docs](https://sendgrid.com/docs/API_Reference/index.html)
-- [v3 Web API](https://github.com/sendgrid/sendgrid-csharp/tree/v3beta/USAGE.md)
-- [Example Code](https://github.com/sendgrid/sendgrid-csharp/tree/v3beta/examples)
-- [v3 Web API Mail Send Helper](https://github.com/sendgrid/sendgrid-csharp/tree/v3beta/SendGrid/SendGrid/Helpers/Mail)
+We encourage contribution to our library, please see our [CONTRIBUTING](https://github.com/sendgrid/sendgrid-csharp/tree/v3beta/CONTRIBUTING.md) guide for details.
-## Unsupported Libraries
+Quick links:
-- [Official and Unsupported SendGrid Libraries](https://sendgrid.com/docs/Integrate/libraries.html)
+- [Feature Request](https://github.com/sendgrid/sendgrid-csharp/tree/v3beta/CONTRIBUTING.md#feature_request)
+- [Bug Reports](https://github.com/sendgrid/sendgrid-csharp/tree/v3beta/CONTRIBUTING.md#submit_a_bug_report)
+- [Sign the CLA to Create a Pull Request](https://github.com/sendgrid/sendgrid-csharp/tree/v3beta/CONTRIBUTING.md#cla)
+- [Improvements to the Codebase](https://github.com/sendgrid/sendgrid-csharp/tree/v3beta/CONTRIBUTING.md#improvements_to_the_codebase)
# About
-![SendGrid Logo]
-(https://assets3.sendgrid.com/mkt/assets/logos_brands/small/sglogo_2015_blue-9c87423c2ff2ff393ebce1ab3bd018a4.png)
-
sendgrid-csharp is guided and supported by the SendGrid [Developer Experience Team](mailto:dx@sendgrid.com).
sendgrid-csharp is maintained and funded by SendGrid, Inc. The names and logos for sendgrid-csharp are trademarks of SendGrid, Inc.
+![SendGrid Logo]
+(https://assets3.sendgrid.com/mkt/assets/logos_brands/small/sglogo_2015_blue-9c87423c2ff2ff393ebce1ab3bd018a4.png)
diff --git a/USAGE.md b/USAGE.md
deleted file mode 100644
index 8bdad19..0000000
--- a/USAGE.md
+++ /dev/null
@@ -1,94 +0,0 @@
-```csharp
-using System;
-using System.Collections.Generic;
-using System.Web.Script.Serialization;
-using SendGrid.Helpers.Mail;
-
-namespace Example
-{
- internal class Example
- {
- private static void Main()
- {
- String apiKey = Environment.GetEnvironmentVariable("SENDGRID_APIKEY", EnvironmentVariableTarget.User);
- dynamic sg = new SendGrid.SendGridAPIClient(apiKey);
-
- string queryParams = @"{
- 'limit': 100
- }";
- dynamic response = sg.client.api_keys.get(queryParams: queryParams);
- Console.WriteLine(response.StatusCode);
- Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result);
- Console.WriteLine(response.ResponseHeaders.ToString());
-
- Console.WriteLine("\n\nPress any key to continue to POST.");
- Console.ReadLine();
-
- // POST
- string requestBody = @"{
- 'name': 'My API Key 5',
- 'scopes': [
- 'mail.send',
- 'alerts.create',
- 'alerts.read'
- ]
- }";
- response = sg.client.api_keys.post(requestBody: requestBody);
- Console.WriteLine(response.StatusCode);
- Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result);
- Console.WriteLine(response.ResponseHeaders.ToString());
- JavaScriptSerializer jss = new JavaScriptSerializer();
- var ds_response = jss.Deserialize<Dictionary<string, dynamic>>(response.ResponseBody.ReadAsStringAsync().Result);
- string api_key_id = ds_response["api_key_id"];
-
- Console.WriteLine("\n\nPress any key to continue to GET single.");
- Console.ReadLine();
-
- // GET Single
- response = sg.client.api_keys._(api_key_id).get();
- Console.WriteLine(response.StatusCode);
- Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result);
- Console.WriteLine(response.ResponseHeaders.ToString());
-
- Console.WriteLine("\n\nPress any key to continue to PATCH.");
- Console.ReadLine();
-
- // PATCH
- requestBody = @"{
- 'name': 'A New Hope'
- }";
- response = sg.client.api_keys._(api_key_id).patch(requestBody: requestBody);
- Console.WriteLine(response.StatusCode);
- Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result);
- Console.WriteLine(response.ResponseHeaders.ToString());
-
- Console.WriteLine("\n\nPress any key to continue to PUT.");
- Console.ReadLine();
-
- // PUT
- requestBody = @"{
- 'name': 'A New Hope',
- 'scopes': [
- ' user.profile.read',
- ' user.profile.update'
- ]
- }";
- response = sg.client.api_keys._(api_key_id).put(requestBody: requestBody);
- Console.WriteLine(response.StatusCode);
- Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result);
- Console.WriteLine(response.ResponseHeaders.ToString());
-
- Console.WriteLine("\n\nPress any key to continue to DELETE.");
- Console.ReadLine();
-
- // DELETE
- response = sg.client.api_keys._(api_key_id).delete();
- Console.WriteLine(response.StatusCode);
- Console.WriteLine(response.ResponseHeaders.ToString());
-
- Console.WriteLine("\n\nPress any key to exit.");
- Console.ReadLine();
- }
- }
-}
-``` \ No newline at end of file