Curiosus.EMail.UnisenderGo
3.0.0
dotnet add package Curiosus.EMail.UnisenderGo --version 3.0.0
NuGet\Install-Package Curiosus.EMail.UnisenderGo -Version 3.0.0
<PackageReference Include="Curiosus.EMail.UnisenderGo" Version="3.0.0" />
<PackageVersion Include="Curiosus.EMail.UnisenderGo" Version="3.0.0" />
<PackageReference Include="Curiosus.EMail.UnisenderGo" />
paket add Curiosus.EMail.UnisenderGo --version 3.0.0
#r "nuget: Curiosus.EMail.UnisenderGo, 3.0.0"
#:package Curiosus.EMail.UnisenderGo@3.0.0
#addin nuget:?package=Curiosus.EMail.UnisenderGo&version=3.0.0
#tool nuget:?package=Curiosus.EMail.UnisenderGo&version=3.0.0
Curiosus.EMail.UnisenderGo
Unisender Go implementation of IEMailSender from
Curiosus.EMail. Sends transactional e-mails through the
Unisender Go HTTP API, with optional link/read tracking and an unsubscribe URL.
Installation
dotnet add package Curiosus.EMail.UnisenderGo
Usage
Options (UnisenderGoEmailOptions, validated on registration):
UnisenderGo:
ApiKey: <secret> # required
Region: Russia # default and currently the only region
EmailFrom: noreply@example.com # required
FromName: Example # required
ReplyTo: support@example.com # optional
UnsubscribeUrl: https://example.com/unsubscribe # optional
TrackLinks: true # optional
TrackReads: true # optional
SkipUnisenderUnsubscribeFooter: false # optional, works only if enabled for your account
IgnoreIncorrectExtraParamsType: false
using Curiosus.EMail;
using Curiosus.Email.UnisenderGo;
var unisenderOptions = builder.Configuration.GetSection("UnisenderGo").Get<UnisenderGoEmailOptions>()!;
builder.Services.AddUnisenderGoEmailSender(unisenderOptions); // IUnisenderGoEmailSender and, by default, IEMailSender
// in a service that receives IEMailSender sender
var response = await sender.SendAsync("user@example.com", "Welcome", "<p>Hello!</p>", isBodyHtml: true, ct);
// override settings for one message
await sender.SendAsync("user@example.com", "News", "<p>News</p>", true,
new UnisenderGoEmailExtraParams(fromName: "Newsletter", trackLinks: false), ct);
HTTP errors are mapped to EmailError: 401 → Auth, 403 → Auth or RateLimit (by Unisender error code),
400 → IncorrectRequestData, 429 → RateLimit, 404 and 5xx → Communication.
Note: the namespace is Curiosus.Email.UnisenderGo (while the package id is Curiosus.EMail.UnisenderGo).
HTTP requests go through the HttpClient named UnisenderGoEmailSender.HttpClientName from IHttpClientFactory,
which AddUnisenderGoEmailSender registers. Configure it for timeouts, a proxy or resilience handlers:
services.AddHttpClient(UnisenderGoEmailSender.HttpClientName, client => client.Timeout = TimeSpan.FromSeconds(30));
See also
- Curiosus.EMail —
IEMailSenderabstraction - Curiosus.EMail.SMTP, Curiosus.EMail.Mailgun — other providers
- Curiosus.Utils — all packages
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Curiosus.Configuration (>= 2.0.0)
- Curiosus.EMail (>= 2.0.0)
- Microsoft.Extensions.Http (>= 10.0.3)
-
net9.0
- Curiosus.Configuration (>= 2.0.0)
- Curiosus.EMail (>= 2.0.0)
- Microsoft.Extensions.Http (>= 9.0.13)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.