Skip to content

Commit

Permalink
Merge branch 'release/2.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jericho committed Dec 16, 2021
2 parents 75b455a + c6e2336 commit 1e25ba4
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 24 deletions.
13 changes: 2 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,18 @@ Cake.SendGrid is an Addin for [Cake](http://cakebuild.net/) which allows sending

## Usage

First, include a reference to this addin in your script like this:
First, include a reference to this addin in your script like this (of course, replace `x.y.z` with the latest version available on [NuGet](https://www.nuget.org/packages/Cake.SendGrid)):

```csharp
#addin nuget:?package=Cake.SendGrid&version=0.8.2&loaddependencies=true
#addin nuget:?package=Cake.SendGrid&version=x.y.z&loaddependencies=true
```
Please note: `0.8.2` is the latest version of the Cake.SendGrid addin as of this writing but there may be a more recent version that was published since then. I encourage you to double check what is the latest available version on NuGet.

Second, we highly recommend that you add the following 'using' statement in your script. Technically, this is not necesary, but it simplifies dealing with attachements:

```csharp
using Cake.Email.Common;
```

Also, this addin is designed to take advantage of some of the new features released in CakeBuild version `0.33.0` therefore your `tools\package.config` should look like this:

```xml
<packages>
<package id="Cake" version="0.33.0" />
</packages>
```

## Information

| |Stable|Pre-release|
Expand Down
21 changes: 14 additions & 7 deletions Source/Cake.SendGrid/Cake.SendGrid.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net461;net5.0</TargetFrameworks>
<TargetFrameworks>net6.0;net5.0;netcoreapp3.1</TargetFrameworks>
<PlatformTarget>anycpu</PlatformTarget>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<OutputType>Library</OutputType>
<DebugType>full</DebugType>
<DebugType>embedded</DebugType>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<PropertyGroup>
Expand All @@ -25,14 +27,19 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Cake.Core" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="Cake.Email.Common" Version="1.0.0" />
<PackageReference Include="StrongGrid" Version="0.76.0" />
<PackageReference Include="Cake.Core" Version="2.0.0" PrivateAssets="All" />
<PackageReference Include="Cake.Email.Common" Version="2.0.0" />
<PackageReference Include="StrongGrid" Version="0.84.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />
</ItemGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Release' ">
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

<ItemGroup>
<None Include="..\PackageIcon.png" Pack="true" PackagePath="" />
<None Include="..\PackageIcon.png" Pack="true" PackagePath="" />
<None Include="..\..\README.md" Pack="true" PackagePath="" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 3 additions & 1 deletion Source/Cake.SendGrid/SendGridAliases.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
using Cake.Core;
using Cake.Core;
using Cake.Core.Annotations;
using System;

[assembly: CLSCompliant(true)]

namespace Cake.SendGrid
{
/// <summary>
Expand Down
10 changes: 8 additions & 2 deletions Source/Cake.SendGrid/SendGridProvider.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Cake.Core;
using Cake.Core;
using Cake.Core.Annotations;
using Cake.Core.Diagnostics;
using Cake.SendGrid.Email;
Expand Down Expand Up @@ -281,7 +281,13 @@ public SendGridResult SendEmail(string senderName, string senderAddress, IEnumer
};
}).ToArray();

var messageId = client.Mail.SendAsync(personalizations, subject, contents, from, null, sendGridAttachments, null, null, null, null, null, null, null, null, null, null, trackingSettings).Result;
var messageId = client.Mail.SendAsync(
personalizations: personalizations,
subject: subject,
contents: contents,
from: from,
attachments: sendGridAttachments,
trackingSettings: trackingSettings).GetAwaiter().GetResult();
return new SendGridResult(true, messageId, DateTime.UtcNow.ToString("u"), string.Empty);
}
}
Expand Down
Binary file modified Source/PackageIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 5 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
init:
- git config --global core.autocrlf true

# scripts to run before build
before_build:
- dotnet --info

# Build script
build_script:
- dotnet --info
- ps: .\build.ps1 --target=CI

# Tests
Expand All @@ -24,7 +27,7 @@ cache:
- tools -> recipe.cake

# Environment configuration
image: Visual Studio 2019
image: Visual Studio 2022

#---------------------------------#
# Skip builds for doc changes #
Expand Down
6 changes: 6 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"sdk": {
"version": "6.0.100",
"rollForward": "latestFeature"
}
}
2 changes: 1 addition & 1 deletion recipe.cake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#load nuget:?package=Cake.Recipe&version=2.2.0
#load nuget:?package=Cake.Recipe&version=2.2.1

Environment.SetVariableNames();

Expand Down

0 comments on commit 1e25ba4

Please sign in to comment.