Skip to content

Commit

Permalink
Updated versions and metadata. Fixed mailgun tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
bjcull committed Feb 4, 2017
1 parent b730aa4 commit 6107f5a
Show file tree
Hide file tree
Showing 16 changed files with 81 additions and 25 deletions.
2 changes: 2 additions & 0 deletions .vs/restore.dg
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#:C:\Data\Projects\FluentEmail\src\Senders\FluentEmail.Mailgun\FluentEmail.Mailgun.xproj
C:\Data\Projects\FluentEmail\src\Senders\FluentEmail.Mailgun\FluentEmail.Mailgun.xproj|C:\Data\Projects\FluentEmail\src\FluentEmail.Core\FluentEmail.Core.xproj
#:C:\Data\Projects\FluentEmail\FluentEmail.Mailgun.Tests\FluentEmail.Mailgun.Tests.xproj
C:\Data\Projects\FluentEmail\FluentEmail.Mailgun.Tests\FluentEmail.Mailgun.Tests.xproj|C:\Data\Projects\FluentEmail\src\Senders\FluentEmail.Mailgun\FluentEmail.Mailgun.xproj
C:\Data\Projects\FluentEmail\src\Senders\FluentEmail.Mailgun\FluentEmail.Mailgun.xproj|C:\Data\Projects\FluentEmail\src\FluentEmail.Core\FluentEmail.Core.xproj
7 changes: 4 additions & 3 deletions FluentEmail.Mailgun.Tests/FluentEmail.Mailgun.Tests.xproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>

<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>6f1f1ab6-f05b-46db-9251-10c3d9b10bda</ProjectGuid>
Expand All @@ -13,9 +12,11 @@
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>

<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>
</Project>
10 changes: 6 additions & 4 deletions FluentEmail.Mailgun.Tests/MailgunSenderTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using FluentEmail.Core;
using System.Threading.Tasks;
using FluentEmail.Core;
using NUnit.Framework;

namespace FluentEmail.Mailgun.Tests
Expand All @@ -18,14 +19,15 @@ public void SetUp()
}

[Test]
public void CanSendEmail()
public async Task CanSendEmail()
{
var email = Email
.From(fromEmail)
.To(toEmail)
.Body("Test");
.Subject(subject)
.Body(body);

var response = email.Send();
var response = await email.SendAsync();

Assert.IsTrue(response.Successful);
}
Expand Down
1 change: 1 addition & 0 deletions FluentEmail.Mailgun.Tests/project.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"version": "1.0.0-*",
"testRunner": "nunit",

"dependencies": {
"NETStandard.Library": "1.6.1-preview1-24530-04",
Expand Down
10 changes: 5 additions & 5 deletions FluentEmail.Mailgun.Tests/project.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -2632,7 +2632,7 @@
"lib/netstandard1.3/System.Xml.XPath.XDocument.dll": {}
}
},
"FluentEmail.Core/2.0.0": {
"FluentEmail.Core/2.0.2": {
"type": "project",
"framework": ".NETStandard,Version=v1.6",
"dependencies": {
Expand All @@ -2645,11 +2645,11 @@
"netstandard1.6/FluentEmail.Core.dll": {}
}
},
"FluentEmail.Mailgun/2.0.0": {
"FluentEmail.Mailgun/2.0.2": {
"type": "project",
"framework": ".NETStandard,Version=v1.6",
"dependencies": {
"FluentEmail.Core": "2.0.0",
"FluentEmail.Core": "2.0.2",
"NETStandard.Library": "1.6.0",
"RestSharp.NetCore": "105.2.3"
},
Expand Down Expand Up @@ -7977,12 +7977,12 @@
"ref/xamarinwatchos10/_._"
]
},
"FluentEmail.Core/2.0.0": {
"FluentEmail.Core/2.0.2": {
"type": "project",
"path": "../src/FluentEmail.Core/project.json",
"msbuildProject": "../src/FluentEmail.Core/FluentEmail.Core.xproj"
},
"FluentEmail.Mailgun/2.0.0": {
"FluentEmail.Mailgun/2.0.2": {
"type": "project",
"path": "../src/Senders/FluentEmail.Mailgun/project.json",
"msbuildProject": "../src/Senders/FluentEmail.Mailgun/FluentEmail.Mailgun.xproj"
Expand Down
2 changes: 2 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Send email from .NET or .NET Core. A bunch of useful extension packages make thi

[FluentEmail.Razor]() - Generate emails using Razor templates. Anything you can do in ASP.NET is possible here. Uses the [RazorLight]() project under the hood.

[FluentEmail.Mailgun]() - Send emails via MailGun's REST API. Works with .NET Core :)

## Usage

You can choose which renderer and sender you would like to use, or build your own inheriting from ITemplateRenderer and ISender.
Expand Down
Binary file added assets/fluentemail_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/fluentemail_logo_64x64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions src/FluentEmail.Core/project.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"version": "2.0.0-*",
"version": "2.0.2",
"title": "Fluent Email",
"description": "Just the domain model. Includes very basic defaults, but is also included with every other package here.",
"description": "Send emails very easily. Use razor templates, smtp, embedded files, all without hassle. This is a Base Package and includes just the domain model, very basic defaults, and is also included with every other Fluent Email package here.",
"authors": [ "Luke Lowrey", "Ben Cull", "Github Contributors" ],
"packOptions": {
"iconUrl": "https://raw.githubusercontent.com/lukencode/FluentEmail/master/assets/fluentemail_logo_64x64.png",
"repository": { "url": "https://github.com/lukencode/FluentEmail" },
"projectUrl": "https://github.com/lukencode/FluentEmail",
"tags": [ "email", "razor", "smtp", "fluent", "fluentemail" ]
Expand Down
5 changes: 3 additions & 2 deletions src/Renderers/FluentEmail.Razor/project.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{
"version": "2.0.0-*",
"version": "2.0.2",
"title": "Fluent Email - Razor",
"description": "Generate emails using Razor templates. Anything you can do in ASP.NET is possible here. Uses the RazorLight project under the hood.",
"authors": [ "Luke Lowrey", "Ben Cull", "Github Contributors" ],
"packOptions": {
"iconUrl": "https://raw.githubusercontent.com/lukencode/FluentEmail/master/assets/fluentemail_logo_64x64.png",
"repository": { "url": "https://github.com/lukencode/FluentEmail" },
"projectUrl": "https://github.com/lukencode/FluentEmail",
"tags": [ "email", "razor", "smtp", "fluent", "fluentemail" ]
},

"dependencies": {
"FluentEmail.Core": "1.0.0-*",
"FluentEmail.Core": "2.0.2",
"NETStandard.Library": "1.6.0",
"RazorLight": "1.0.0-rc1"
},
Expand Down
2 changes: 1 addition & 1 deletion src/Senders/FluentEmail.Mailgun/MailgunSender.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public MailgunSender(string domainName, string apiKey)

public SendResponse Send(Email email, CancellationToken? token = null)
{
throw new NotImplementedException();
return SendAsync(email, token).GetAwaiter().GetResult();
}

public Task<SendResponse> SendAsync(Email email, CancellationToken? token = null)
Expand Down
40 changes: 40 additions & 0 deletions src/Senders/FluentEmail.Mailgun/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Fluent Email - MailGun

Send email via the MailGun REST API.

## Packages

`FluentEmail.Mailgun`

## Usage

Create a new instance of your sender and add it as the default Fluent Email sender.

var sender = new MailgunSender(
"sandboxcf5f41bbf2f84f15a386c60e253b5fe9.mailgun.org", // Mailgun Domain
"key-8d32c046d7f14ada8d5ba8253e3e30de" // Mailgun API Key
);
Email.DefaultSender = sender;

/*
You can optionally set the sender per instance like so:
email.Sender = new MailgunSender(...);
*/

Send the email in the usual Fluent Email way.

var email = Email
.From(fromEmail)
.To(toEmail)
.Subject(subject)
.Body(body);

var response = await email.SendAsync();


## Further Information

Don't forget you can use Razor templating using the [FluentEmail.Razor]() package as well.

If you'd like to create your own sender for another service, check out the source code. All you need to do is implement the `ISender` interface :)
5 changes: 3 additions & 2 deletions src/Senders/FluentEmail.Mailgun/project.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{
"version": "2.0.0-*",
"version": "2.0.2",
"title": "Fluent Email - MailGun",
"description": "Send emails via MailGun using their REST API",
"authors": [ "Luke Lowrey", "Ben Cull", "Github Contributors" ],
"packOptions": {
"iconUrl": "https://raw.githubusercontent.com/lukencode/FluentEmail/master/assets/fluentemail_logo_64x64.png",
"repository": { "url": "https://github.com/lukencode/FluentEmail" },
"projectUrl": "https://github.com/lukencode/FluentEmail",
"tags": [ "email", "razor", "mailgun", "fluent", "fluentemail" ]
},

"dependencies": {
"FluentEmail.Core": "2.0.0-*",
"FluentEmail.Core": "2.0.2",
"NETStandard.Library": "1.6.0",
"RestSharp.NetCore": "105.2.3"
},
Expand Down
6 changes: 3 additions & 3 deletions src/Senders/FluentEmail.Mailgun/project.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -1440,7 +1440,7 @@
"lib/netstandard1.3/System.Xml.XmlSerializer.dll": {}
}
},
"FluentEmail.Core/2.0.0": {
"FluentEmail.Core/2.0.2": {
"type": "project",
"framework": ".NETStandard,Version=v1.6",
"dependencies": {
Expand Down Expand Up @@ -5184,15 +5184,15 @@
"runtimes/aot/lib/netcore50/System.Xml.XmlSerializer.dll"
]
},
"FluentEmail.Core/2.0.0": {
"FluentEmail.Core/2.0.2": {
"type": "project",
"path": "../../FluentEmail.Core/project.json",
"msbuildProject": "../../FluentEmail.Core/FluentEmail.Core.xproj"
}
},
"projectFileDependencyGroups": {
"": [
"FluentEmail.Core >= 2.0.0-*",
"FluentEmail.Core >= 2.0.2",
"NETStandard.Library >= 1.6.0",
"RestSharp.NetCore >= 105.2.3"
],
Expand Down
5 changes: 3 additions & 2 deletions src/Senders/FluentEmail.Smtp/project.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
{
"version": "2.0.0-*",
"version": "2.0.2",
"title": "Fluent Email - SMTP",
"description": "Now we're talking. Send emails via SMTP. At the moment, only works on .NET 4.",
"authors": [ "Luke Lowrey", "Ben Cull", "Github Contributors" ],
"packOptions": {
"iconUrl": "https://raw.githubusercontent.com/lukencode/FluentEmail/master/assets/fluentemail_logo_64x64.png",
"repository": { "url": "https://github.com/lukencode/FluentEmail" },
"projectUrl": "https://github.com/lukencode/FluentEmail",
"tags": [ "email", "razor", "smtp", "fluent", "fluentemail" ]
},

"dependencies": {
"NETStandard.Library": "1.6.0",
"FluentEmail.Core": "1.0.0-*"
"FluentEmail.Core": "2.0.2"
},

"frameworks": {
Expand Down
6 changes: 5 additions & 1 deletion test/FluentEmail.Core.Tests/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
"include": [
"*.txt"
]
}
},
"copyToOutput": [
"*.txt"
]
}
}

0 comments on commit 6107f5a

Please sign in to comment.