TheNerdCollective.Integrations.Brevo
1.0.4
dotnet add package TheNerdCollective.Integrations.Brevo --version 1.0.4
NuGet\Install-Package TheNerdCollective.Integrations.Brevo -Version 1.0.4
<PackageReference Include="TheNerdCollective.Integrations.Brevo" Version="1.0.4" />
<PackageVersion Include="TheNerdCollective.Integrations.Brevo" Version="1.0.4" />
<PackageReference Include="TheNerdCollective.Integrations.Brevo" />
paket add TheNerdCollective.Integrations.Brevo --version 1.0.4
#r "nuget: TheNerdCollective.Integrations.Brevo, 1.0.4"
#:package TheNerdCollective.Integrations.Brevo@1.0.4
#addin nuget:?package=TheNerdCollective.Integrations.Brevo&version=1.0.4
#tool nuget:?package=TheNerdCollective.Integrations.Brevo&version=1.0.4
TheNerdCollective.Integrations.Brevo
.NET client for the Brevo API v3.
Features
- Create or update a contact with typed, generic attributes and list membership
- Read, create, update supported options, and delete contact attributes
- Send a transactional email
- Resolve API keys from configuration or an optional persistent store
- Dependency injection and Polly retry for transient failures
Installation
dotnet add package TheNerdCollective.Integrations.Brevo
Quick start
{
"Brevo": {
"ApiKey": "your_brevo_api_key"
}
}
builder.Services.AddBrevoIntegration(builder.Configuration);
await brevo.CreateOrUpdateContactWithAttributesAsync(
"guest@example.com",
attributes: new Dictionary<string, object?>
{
["FIRSTNAME"] = "Guest",
["INTERESTS"] = new[] { "cafe", "news" },
["INQUIRY_TYPE"] = new[] { "tasting_box" }
},
listIds: [12]);
await brevo.SendEmailAsync(
senderEmail: "hello@example.com",
senderName: "Example",
toEmail: "inbox@example.com",
toName: null,
subject: "New inquiry",
textContent: "A guest asked to be contacted.");
Attribute names must already exist in the Brevo account. The sender address must be a verified sender.
The original CreateOrUpdateContactAsync and CreateOrUpdateContactAndGetIdAsync methods remain available for string-valued attributes. Use the ...WithAttributes... methods for arrays, booleans, numbers, and other typed values.
For a contact without an email address, use the SMS phone number as its unique identifier:
await brevo.CreateOrUpdateContactByPhoneAndGetIdAsync(
"+4528876905",
attributes: new Dictionary<string, string>
{
["FIRSTNAME"] = "Guest"
},
listIds: [12]);
The method adds the formatted number as the SMS contact attribute.
Manage contact attributes
BrevoDataResult<IReadOnlyList<BrevoContactAttribute>> attributes =
await brevo.ListContactAttributesAsync();
BrevoResult create = await brevo.CreateContactAttributeAsync(
"normal",
"INTERESTS",
new BrevoContactAttributeWriteOptions(
Type: "multiple-choice",
MultiCategoryOptions: ["cafe", "products", "recipes", "news"]));
BrevoResult update = await brevo.UpdateContactAttributeAsync(
"normal",
"INTERESTS",
new BrevoContactAttributeWriteOptions(
MultiCategoryOptions: ["cafe", "products", "recipes", "news"]));
BrevoResult delete = await brevo.DeleteContactAttributeAsync("normal", "INTERESTS");
GetContactAttributeAsync reads one attribute from Brevo's attribute catalog. Brevo's update endpoint can update supported enumeration values, multiple-choice options, or calculated/global formulas, but cannot change an attribute's type. Deleting an attribute permanently removes its values from contacts.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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
- Microsoft.Extensions.Configuration (>= 10.0.10)
- Microsoft.Extensions.DependencyInjection (>= 10.0.10)
- Microsoft.Extensions.Http (>= 10.0.10)
- Microsoft.Extensions.Http.Polly (>= 10.0.10)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.10)
- Polly (>= 8.7.0)
- Polly.Extensions.Http (>= 3.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on TheNerdCollective.Integrations.Brevo:
| Package | Downloads |
|---|---|
|
TheNerdCollective.Integrations.Umbraco.Brevo
Brevo backoffice section, dashboard, and CMS settings reader for Umbraco CMS. |
GitHub repositories
This package is not used by any popular GitHub repositories.