VOOZH about

URL: https://www.nuget.org/packages/SoundInTheory.Piranha.Emails/

⇱ NuGet Gallery | SoundInTheory.Piranha.Emails 1.0.0




SoundInTheory.Piranha.Emails 1.0.0

dotnet add package SoundInTheory.Piranha.Emails --version 1.0.0
 
 
NuGet\Install-Package SoundInTheory.Piranha.Emails -Version 1.0.0
 
 
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SoundInTheory.Piranha.Emails" Version="1.0.0" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SoundInTheory.Piranha.Emails" Version="1.0.0" />
 
Directory.Packages.props
<PackageReference Include="SoundInTheory.Piranha.Emails" />
 
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SoundInTheory.Piranha.Emails --version 1.0.0
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: SoundInTheory.Piranha.Emails, 1.0.0"
 
 
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SoundInTheory.Piranha.Emails@1.0.0
 
 
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SoundInTheory.Piranha.Emails&version=1.0.0
 
Install as a Cake Addin
#tool nuget:?package=SoundInTheory.Piranha.Emails&version=1.0.0
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Piranha Emails

Module that simplifies the sending of emails, including the management of email templates.

This module is still in development and not recommended for public use.

Key Features

  • Customisable email templates that can be edited directly in Piranha
  • MJML and Handlebars Templating to make designing and editing emails easy.
  • Handlebars lets you place complex methods behind a single tag
  • You can also customise the subject line with Handlebars
  • Configurable senders that work with both SMTP and Mailgun
  • Support for sample data and previewing with multiple sample sets
  • A test email sender

Usage

Set up Email Sender in appsettings.json. SMTP or Mailgun is currently supported.

{
 "PiranhaEmails": {
 "Senders": {
 "TestSender": {
 "FromEmail": "example@example.com",
 "FromName": "Mr Example",
 "SendToWhiteList": [],
 "SmtpSettings": {
 "SmtpUser": "example@example.com",
 "SmtpPassword": "password",
 "SmtpServer": "smtp.gmail.com",
 "SmtpPort": 465,
 "UseSsl": true,
 "RequiresAuthentication": true
 },
 //or
 "MailgunSettings": {
 "MailgunSendingKey": "sendingkeyhere",
 "MailgunDomain": "domain.example",
 "MailgunRegion": "USAorEU"
 }
 } 
 }
 }
}

Set up Email Template

[EmailTemplate(enabled: true)]
public class ResetPasswordTemplate : EmailTemplateInfo
{
 public new const string Key = "ResetPasswordEmail";

 public ResetPasswordTemplate()
 {
 Title = "Reset Password Email";
 
 //View model can be anything that ineherits EmailViewModel
 SampleData = new ResetPasswordEmailViewModel()
 {
 ResetLink = "http://www.exampleresetpassword.com/",
 };

 }
}

Add emails on startup

builder.AddPiranha(options => 
{
 //other services here

 options.Services.AddPiranhaEmails(builder)
 .AddEmailTemplates(typeof(MyWebsite).Assembly);//reference assembly with email
})

app.UsePiranha(options => {
 //other services here

 options.UsePiranhaEmails();
})

The template should be visible in the manager. Edit as required.

To send, use GenericEmailHandler


var contactUsTemplateInfo = _services.GetKeyedService<EmailTemplateInfo>("ContactUsEmail");
var contactUs = await _emailTemplateResolver.ResolveAsync("ContactUsEmail");

//DI'ed GenericEmailHandler
_emailHandler.Send(
 contactUs.Template.EmailSenderKey,
 toAddress,
 contactUs.Template.SubjectLine,
 contactUs.Template.Content,
 new ContactFormViewModel(){
 Form = etc
 }
);
Product Versions Compatible and additional computed target framework versions.
.NET net9.0 net9.0 is compatible.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 was computed.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on SoundInTheory.Piranha.Emails:

Package Downloads
SoundInTheory.Piranha.Identity.Extensions

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 134 3/18/2026