Settle.Notifications
0.1.1-alpha1
This is a prerelease version of Settle.Notifications.
dotnet add package Settle.Notifications --version 0.1.1-alpha1
NuGet\Install-Package Settle.Notifications -Version 0.1.1-alpha1
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="Settle.Notifications" Version="0.1.1-alpha1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Settle.Notifications --version 0.1.1-alpha1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Settle.Notifications, 0.1.1-alpha1"
#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.
// Install Settle.Notifications as a Cake Addin
#addin nuget:?package=Settle.Notifications&version=0.1.1-alpha1&prerelease
// Install Settle.Notifications as a Cake Tool
#tool nuget:?package=Settle.Notifications&version=0.1.1-alpha1&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Settle.Notifications
Send notifications via Email or SMS (coming soon).
Send an email
// Inject IEmailMessageService via DI
internal sealed class MyEmailService
{
private readonly IEmailMessageService _emailService;
public MyEmailService(IEmailMessageService emailService)
{
_emailService=emailService;
}
public string SendTestEmail(){
var emailResult = Email.Create("test@example.com");
var subject = "Test email";
var body = "This is a test email message";
var result = _emailService.SendMessageAsync(emailResult.Value, subject, body);
}
}
Send a templated email
This option allows you to define a template and the service will replace matching values for you. This uses the Liquid templating engine to process the file.
internal sealed class MyEmailService
{
public string SendTemplatedTestEmail(){
var emailResult = Email.Create("test@example.com");
var subject = "Test email";
var body = @"
<p>Here's my template</p>
<ul>
<li>{{ Name }}</li>
<li>{{ Description }}</li>
</ul>";
var templateModel = new SampleTemplateModel("Test User","Test Description");
var result = _emailService.SendMessageWithTemplateAsync(emailResult.Value, subject, body, templateModel);
}
}
public sealed record SampleTemplateModel(string Name, string Description):ITemplateModel
{
}
Send a templated email with a base template
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- Fluid.Core (>= 2.5.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 6.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 6.0.0)
- Microsoft.Extensions.Logging (>= 6.0.0)
- Microsoft.Extensions.Options (>= 6.0.0)
- Settle.Notifications.Configuration (>= 1.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Settle.Notifications:
Package | Downloads |
---|---|
Settle.Notifications.Mailgun
Library for Settle.Notifications which enables sending of email via Mailgun API. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.1.1-alpha1 | 74 | 5/6/2024 |
0.1.0-alpha1 | 59 | 5/5/2024 |
Initial preview release - revert MS libraries to v6