Skip to content

Commit

Permalink
Merge branch 'master' into 716-dynamic-template-support
Browse files Browse the repository at this point in the history
  • Loading branch information
carl-underwood authored Aug 22, 2018
2 parents 7eafad1 + 00e543d commit 38a42e3
Show file tree
Hide file tree
Showing 37 changed files with 644 additions and 500 deletions.
10 changes: 8 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,15 @@ script:
- dotnet restore
- dotnet build ./src/SendGrid -c Release
- dotnet test ./tests/SendGrid.Tests/SendGrid.Tests.csproj -c Release -f netcoreapp1.0
- ls /home/travis/build/sendgrid/sendgrid-csharp/src/SendGrid/bin/Release/net452/
- ls /home/travis/build/sendgrid/sendgrid-csharp/src/SendGrid/bin/Release/netstandard1.3/
- ls ./src/SendGrid/bin/Release/net452/
- ls ./src/SendGrid/bin/Release/netstandard1.3/
- dotnet pack ./src/SendGrid -c Release
- curl -s https://codecov.io/bash > .codecov
- chmod +x .codecov
- ./.codecov

after_success:
- bash <(curl -s https://codecov.io/bash)

notifications:
hipchat:
Expand Down
18 changes: 12 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Hello! Thank you for choosing to help contribute to one of the SendGrid open sou
- [Testing](#testing)
- [Style Guidelines & Naming Conventions](#style-guidelines-and-naming-conventions)
- [Creating a Pull Request](#creating-a-pull-request)
- [Code Reviews](#code-reviews)

<a name="roadmap"></a>
We use [GitHub Projects](https://github.com/sendgrid/sendgrid-csharp/projects) to help define current roadmaps, please feel free to grab an issue from our [GitHub Issues](https://github.com/sendgrid/sendgrid-csharp/issues). 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.
Expand Down Expand Up @@ -75,7 +76,7 @@ git clone https://github.com/sendgrid/sendgrid-csharp.git

- Open `sendgrid-csharp/SendGrid.sln`

## Environment Variables
### Environment Variables

First, get your free SendGrid account [here](https://sendgrid.com/free?source=sendgrid-csharp).

Expand All @@ -90,23 +91,23 @@ Next, update your Environment with your [SENDGRID_APIKEY](https://app.sendgrid.c
<a name="understanding-the-codebase"></a>
## Understanding the Code Base

**/examples**
**[/examples](https://github.com/sendgrid/sendgrid-csharp/blob/master/examples)**

Examples that demonstrate usage.

**/ExampleCoreProject/Example.cs**
**[/ExampleCoreProject/Example.cs](https://github.com/sendgrid/sendgrid-csharp/blob/master/ExampleCoreProject/Example.cs)**

A working .NET Core example project for testing.

**/ExampleNet45Project/Example.cs**
**[/ExampleNet45Project/Example.cs](https://github.com/sendgrid/sendgrid-csharp/blob/master/ExampleNet45Project/Example.cs)**

A working .NET 4.5.2 example project for testing.

**src/SendGrid/SendGridClient.cs**
**[/src/SendGrid/SendGridClient.cs](https://github.com/sendgrid/sendgrid-csharp/blob/master/src/SendGrid/SendGridClient.cs)**

The main interface to the SendGrid API is the class `SendGridClient`.

**/tests/SendGrid.Tests/Integration.cs**
**[/tests/SendGrid.Tests/Integration.cs](https://github.com/sendgrid/sendgrid-csharp/blob/master/tests/SendGrid.Tests/Integration.cs)**

Integration tests

Expand Down Expand Up @@ -187,3 +188,8 @@ Generally, we follow the style guidelines as suggested by the official language.
with a clear title and description against the `master` branch. All tests must be passing before we will review the PR.

If you have any additional questions, please feel free to [email](mailto:[email protected]) us or create an issue in this repo.

<a name="code-reviews"></a>
## Code Reviews

If you can, please look at open PRs and review them. Give feedback and help us merge these PRs much faster! If you don't know how, Github has some great information on how to review a Pull Request.
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2012-2017 SendGrid, Inc.
Copyright (c) 2012-2018 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
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ Quick links:
- [Bug Reports](https://github.com/sendgrid/sendgrid-csharp/tree/master/CONTRIBUTING.md#submit-a-bug-report)
- [Sign the CLA to Create a Pull Request](https://github.com/sendgrid/sendgrid-csharp/tree/master/CONTRIBUTING.md#cla)
- [Improvements to the Codebase](https://github.com/sendgrid/sendgrid-csharp/tree/master/CONTRIBUTING.md#improvements-to-the-codebase)
- [Review Pull Requests](https://github.com/sendgrid/sendgrid-csharp/tree/master/CONTRIBUTING.md#code-reviews)

<a name="troubleshooting"></a>
# Troubleshooting
Expand Down
2 changes: 1 addition & 1 deletion USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3135,7 +3135,7 @@ Console.ReadLine();

**This endpoint returns a list of all scopes that this user has access to.**

API Keys can be used to authenticate the use of [SendGrids v3 Web API](https://sendgrid.com/docs/API_Reference/Web_API_v3/index.html), or the [Mail API Endpoint](https://sendgrid.com/docs/API_Reference/Web_API/mail.html). API Keys may be assigned certain permissions, or scopes, that limit which API endpoints they are able to access. For a more detailed explanation of how you can use API Key permissios, please visit our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/api_keys.html#-API-Key-Permissions) or [Classroom](https://sendgrid.com/docs/Classroom/Basics/API/api_key_permissions.html).
API Keys can be used to authenticate the use of [SendGrids v3 Web API](https://sendgrid.com/docs/API_Reference/Web_API_v3/index.html), or the [Mail API Endpoint](https://sendgrid.com/docs/API_Reference/Web_API/mail.html). API Keys may be assigned certain permissions, or scopes, that limit which API endpoints they are able to access. For a more detailed explanation of how you can use API Key permissions, please visit our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/api_keys.html#-API-Key-Permissions) or [Classroom](https://sendgrid.com/docs/Classroom/Basics/API/api_key_permissions.html).

### GET /scopes

Expand Down
31 changes: 31 additions & 0 deletions USE_CASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ This documentation provides examples for specific use cases. Please [open an iss
* [Transient Fault Handling](#transient-faults)
* [How to Setup a Domain Whitelabel](#domain-whitelabel)
* [How to View Email Statistics](#email-stats)
* [How to transform HTML to plain text](#html-to-plain-text)

<a name="attachments"></a>
# Attachments
Expand Down Expand Up @@ -845,3 +846,33 @@ Find more information about all of SendGrid's whitelabeling related documentatio
You can find documentation for how to view your email statistics via the UI [here](https://app.sendgrid.com/statistics) and via API [here](https://github.com/sendgrid/sendgrid-csharp/blob/master/USAGE.md#stats).

Alternatively, we can post events to a URL of your choice via our [Event Webhook](https://sendgrid.com/docs/API_Reference/Webhooks/event.html) about events that occur as SendGrid processes your email.

<a name="html-to-plain-text"></a>
# How to transform HTML to plain text

Although the HTML tags could be removed using regular expressions, the best solution is parsing the HTML code with a specific library, such as [HTMLAgilityPack](http://html-agility-pack.net/).

The following code shows how to parse an input string with HTML code and remove all tags:

```csharp
using HtmlAgilityPack;

namespace Example {

internal class Example
{
/// <summary>
/// Convert the HTML content to plain text
/// </summary>
/// <param name="html">The html content which is going to be converted</param>
/// <returns>A string</returns>
public static string HtmlToPlainText(string html)
{
HtmlDocument document = new HtmlDocument();
document.LoadHtml(html);
return document.DocumentNode == null ? string.Empty : document.DocumentNode.InnerText;
}
}
}

```
14 changes: 12 additions & 2 deletions nuspec/Sendgrid.9.9.0.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,26 @@
<copyright>SendGrid, Inc. 2017</copyright>
<tags>SendGrid Email Mail Microsoft Azure Transactional .NET Core</tags>
<dependencies>
<group targetFramework=".NETFramework4.0">
<group targetFramework="net45">
<dependency id="Newtonsoft.Json" version="9.0.1" />
</group>
<group targetFramework="net40">
<dependency id="Newtonsoft.Json" version="9.0.1" />
<dependency id="System.Net.Http" version="4.0.0" />
</group>
<group targetFramework=".NETStandard1.3">
<group targetFramework="netstandard1.3">
<dependency id="NETStandard.Library" version="1.6.1" />
<dependency id="Newtonsoft.Json" version="9.0.1" />
<dependency id="Microsoft.AspNetCore.Http.Abstractions" version="1.1.0" />
</group>
<group targetFramework="netstandard2.0">
<dependency id="Newtonsoft.Json" version="9.0.1" />
<dependency id="Microsoft.AspNetCore.Http.Abstractions" version="1.1.0" />
</group>
</dependencies>
<frameworkAssemblies>
<frameworkAssembly assemblyName="System.Net.Http" targetFramework="net45" />
</frameworkAssemblies>
</metadata>
<files>
<file src="lib\net452\SendGrid.dll" target="lib\net452\SendGrid.dll" />
Expand Down
Loading

0 comments on commit 38a42e3

Please sign in to comment.