FluentEmail.Handlebars
0.1.2
See the version list below for details.
dotnet add package FluentEmail.Handlebars --version 0.1.2
NuGet\Install-Package FluentEmail.Handlebars -Version 0.1.2
<PackageReference Include="FluentEmail.Handlebars" Version="0.1.2" />
paket add FluentEmail.Handlebars --version 0.1.2
#r "nuget: FluentEmail.Handlebars, 0.1.2"
// Install FluentEmail.Handlebars as a Cake Addin
#addin nuget:?package=FluentEmail.Handlebars&version=0.1.2
// Install FluentEmail.Handlebars as a Cake Tool
#tool nuget:?package=FluentEmail.Handlebars&version=0.1.2
FluentEmail Handlebars Plugin
Allows you to use Handlebars rendering engine and author your emails in Handlebars, using the excellent Handlebars.Net.
Basic Usage
var email = Email
.From("john@email.com")
.To("bob@email.com", "bob")
.Subject("hows it going bob")
.Body("yo dawg, sup?")
.Send();
Dependency Injection
You can configure FluentEmail in startup.cs with these helper methods. This will by default inject IFluentEmail (send a single email) and IFluentEmailFactory (used to send multiple emails in a single context) with the ISender and ITemplateRenderer configured using AddHandlebarsRenderer(), AddSmtpSender() or other packages.
public void ConfigureServices(IServiceCollection services)
{
services
.AddFluentEmail("fromemail@test.test")
.AddHandlebarsRenderer()
.AddSmtpSender("localhost", 25);
}
Using a template
// Using Handlebars templating package (or set using AddHandlebarsRenderer in services)
Email.DefaultRenderer = new HandlebarsRenderer();
var template = "Dear {{Name}}, You are totally {{Compliment}}.";
var email = Email
.From("bob@hotmail.com")
.To("somedude@gmail.com")
.Subject("woo nuget")
.UsingTemplate(template, new { Name = "Luke", Compliment = "Awesome" });
Using a template with optional partial templates
Registers partial templates described fully here
// Using Handlebars templating package (or set using AddHandlebarsRenderer(templatePath) in services)
Email.DefaultRenderer = new HandlebarsRenderer("some path to templates");
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- FluentEmail.Core (>= 2.7.0)
- Handlebars.Net (>= 1.10.1)
- Microsoft.CSharp (>= 4.7.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.