![]() |
VOOZH | about |
dotnet add package SoundInTheory.Piranha.Emails --version 1.0.0
NuGet\Install-Package SoundInTheory.Piranha.Emails -Version 1.0.0
<PackageReference Include="SoundInTheory.Piranha.Emails" Version="1.0.0" />
<PackageVersion Include="SoundInTheory.Piranha.Emails" Version="1.0.0" />Directory.Packages.props
<PackageReference Include="SoundInTheory.Piranha.Emails" />Project file
paket add SoundInTheory.Piranha.Emails --version 1.0.0
#r "nuget: SoundInTheory.Piranha.Emails, 1.0.0"
#:package SoundInTheory.Piranha.Emails@1.0.0
#addin nuget:?package=SoundInTheory.Piranha.Emails&version=1.0.0Install as a Cake Addin
#tool nuget:?package=SoundInTheory.Piranha.Emails&version=1.0.0Install as a Cake Tool
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.
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. |
Showing the top 1 NuGet packages that depend on SoundInTheory.Piranha.Emails:
| Package | Downloads |
|---|---|
|
SoundInTheory.Piranha.Identity.Extensions
Package Description |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 134 | 3/18/2026 |