CommunityAbp.Emailing.Postmark 1.0.27-alpha.0.5

This is a prerelease version of CommunityAbp.Emailing.Postmark.
dotnet add package CommunityAbp.Emailing.Postmark --version 1.0.27-alpha.0.5
NuGet\Install-Package CommunityAbp.Emailing.Postmark -Version 1.0.27-alpha.0.5
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="CommunityAbp.Emailing.Postmark" Version="1.0.27-alpha.0.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CommunityAbp.Emailing.Postmark --version 1.0.27-alpha.0.5
#r "nuget: CommunityAbp.Emailing.Postmark, 1.0.27-alpha.0.5"
#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 CommunityAbp.Emailing.Postmark as a Cake Addin
#addin nuget:?package=CommunityAbp.Emailing.Postmark&version=1.0.27-alpha.0.5&prerelease

// Install CommunityAbp.Emailing.Postmark as a Cake Tool
#tool nuget:?package=CommunityAbp.Emailing.Postmark&version=1.0.27-alpha.0.5&prerelease

CommunityAbp.Emailing.Postmark

Postmark is an email delivery service that developers and product teams actually like. Send transactional and marketing emails and get them to the inbox, every time.. This ABP module provides an integration package to use the Postmark as the email sender, even allowing the use of advanced features like templated emails without much fuss.

Getting Started

Into your abp Domain project, install the library:

Install-Package CommunityAbp.Emailing.Postmark

Then, into your abp Domain project, add the following code to your module class:

[DependsOn(typeof(AbpPostmarkModule))]
public class YourProjectDomainModule : AbpModule
{
    // ..

	public override void ConfigureServices(ServiceConfigurationContext context)
    {
        // Setup postmark
        var configuration = context.Services.GetConfiguration();
        Configure<AbpPostmarkOptions>(options =>
        {
            options.UsePostmark = configuration.GetValue("Postmark:Enabled", false);
            options.ApiKey = configuration.GetValue("Postmark:ApiKey", string.Empty);
        });
    }
}

Finally, into your project that is sending email, add the following code to your appsettings.json file:

{
  "Postmark": {
    "Enabled": true,
	"ApiKey": "(your server's API key from Postmark"
  }
}

Usage

It's not used any differently than the default Emailing Sending System from abp. You simply inject IEmailSender and use as you need. If postmark is enabled, it'll send through postmark.

Advanced Usage

You can send Postmark Templated Emails!

var templateModel = new Dictionary<string, object?>
{
    { "product_url", "product_url_Value" },
    { "product_name", "product_name_Value" },
    { "name", "name_Value" },
    { "action_url", "action_url_Value" },
    { "login_url", "login_url_Value" },
    { "username", "username_Value" },
    { "trial_length", "trial_length_Value" },
    { "trial_start_date", "trial_start_date_Value" },
    { "trial_end_date", "trial_end_date_Value" },
    { "support_email", "support_email_Value" },
    { "live_chat_url", "live_chat_url_Value" },
    { "sender_name", "sender_name_Value" },
    { "help_url", "help_url_Value" },
    { "company_name", "company_name_Value" },
    { "company_address", "company_address_Value" },
};
var prop = new Dictionary<string, object?> {
    { AbpPostmarkConsts.PostmarkTemplateId, 34989179L },
    { AbpPostmarkConsts.TemplateModel, templateModel }
  };
await _emailSender.SendAsync("your_cool_address@someprovider.com", null, null, additionalEmailSendingArgs: new AdditionalEmailSendingArgs() { ExtraProperties = new ExtraPropertyDictionary(prop) });

Note: I'm not setting a subject or body, that's because the template has those things defined so they just get ignored here.

Useful

Here's something useful for SMTP testing: Papercut

Product 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 is compatible.  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 netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.27-alpha.0.5 57 3/28/2024
1.0.26 98 2/22/2024
1.0.25 84 2/22/2024
1.0.14-g9e67c4589a 71 2/22/2024
1.0.13-g5a52151a64 66 2/22/2024
1.0.12-ga7289ebc3f 65 2/22/2024
1.0.10-g928a169b33 58 2/22/2024
1.0.1 78 2/22/2024
0.0.0-alpha.0.24 46 2/22/2024