Adliance.AspNetCore.Buddy.Email.AzureCommunicationServices
8.0.0.8
Prefix Reserved
See the version list below for details.
dotnet add package Adliance.AspNetCore.Buddy.Email.AzureCommunicationServices --version 8.0.0.8
NuGet\Install-Package Adliance.AspNetCore.Buddy.Email.AzureCommunicationServices -Version 8.0.0.8
<PackageReference Include="Adliance.AspNetCore.Buddy.Email.AzureCommunicationServices" Version="8.0.0.8" />
paket add Adliance.AspNetCore.Buddy.Email.AzureCommunicationServices --version 8.0.0.8
#r "nuget: Adliance.AspNetCore.Buddy.Email.AzureCommunicationServices, 8.0.0.8"
// Install Adliance.AspNetCore.Buddy.Email.AzureCommunicationServices as a Cake Addin #addin nuget:?package=Adliance.AspNetCore.Buddy.Email.AzureCommunicationServices&version=8.0.0.8 // Install Adliance.AspNetCore.Buddy.Email.AzureCommunicationServices as a Cake Tool #tool nuget:?package=Adliance.AspNetCore.Buddy.Email.AzureCommunicationServices&version=8.0.0.8
Adliance.AspNetCore.Buddy.Email.AzureCommunicationServices
The Azure Communication Buddy makes sending E-Mail easy. Find more detailed information on the Azure website.
Setup library in an ASP.NET project
The IBuddyServiceCollection
of the Adliance.AspNetCore.Buddy.Abstractions
package offers the AddBuddy
method, which provides AddAzureCommunicationEmail
extensions to add the E-Mail services.
using Adliance.AspNetCore.Buddy.Email.AzureCommunicationServices;
// ...
public void ConfigureServices(IServiceCollection services)
{
//...
services.AddBuddy()
.AddAzureCommunicationEmail(Configuration.GetSection("E-Mail"),
Configuration.GetSection("Azure-Communication-Email"))
//...
}
Configuration (appsettings.json)
Add a section in the configuration of your project and add following configuration:
{
"E-Mail": {
"SenderName": "unused (always taken from config in Azure)",
"SenderAddress": "sender@example.com",
"ReplyToAddress": "reply@example.com",
"RedirectAllEmailsTo": "",
"Disable": false
},
"Azure-Communication-Email": {
"Endpoint": "https://<your-communication-service-name>.<region>.communication.azure.com/",
"AccessKey": "your-access-key",
"UserEngagementTrackingDisabled": false
}
}
Look up your API credentials in your Azure portal.
Usage of library
This code sample shows the usage of the Azure Communication email client. Just call the Send
method providing a recipient, subject and a body.
IEmailer emailer = new AzureCommunicationEmailer(azureCommunicationConfig, emailConfig);
await emailer.Send(recipientAddress,
"Descriptive subject line",
"This is the <b>HTML</b> body.",
"This is the **Text** body.");
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | 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. |
-
net8.0
- Adliance.AspNetCore.Buddy.Abstractions (>= 8.0.0.7)
- Adliance.Buddy.CodeStyle (>= 8.0.0.8)
- Azure.Communication.Email (>= 1.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.