Soenneker.Extensions.Messages.Email
4.0.597
Prefix Reserved
dotnet add package Soenneker.Extensions.Messages.Email --version 4.0.597
NuGet\Install-Package Soenneker.Extensions.Messages.Email -Version 4.0.597
<PackageReference Include="Soenneker.Extensions.Messages.Email" Version="4.0.597" />
<PackageVersion Include="Soenneker.Extensions.Messages.Email" Version="4.0.597" />
<PackageReference Include="Soenneker.Extensions.Messages.Email" />
paket add Soenneker.Extensions.Messages.Email --version 4.0.597
#r "nuget: Soenneker.Extensions.Messages.Email, 4.0.597"
#:package Soenneker.Extensions.Messages.Email@4.0.597
#addin nuget:?package=Soenneker.Extensions.Messages.Email&version=4.0.597
#tool nuget:?package=Soenneker.Extensions.Messages.Email&version=4.0.597
Soenneker.Extensions.Messages.Email
Converts the email-specific properties of an EmailMessage into a flat string token dictionary.
Installation
dotnet add package Soenneker.Extensions.Messages.Email
Usage
using Soenneker.Extensions.Messages.Email;
EmailMessage message = CreateEmailMessage();
Dictionary<string, string> tokens = message.ToTokenDictionary();
string subject = tokens["subject"];
// subject == message.Subject
Token names come from [JsonPropertyName] when present (Subject therefore becomes subject); otherwise the CLR property name is used. Only readable, non-indexed public properties declared directly on the sealed EmailMessage type are included. Routing and audit properties inherited from its base message envelope are excluded.
Values use Convert.ToString(object). Null property values become empty strings, and other values use their normal string conversion under the current culture. This is not JSON serialization: recipient lists, token dictionaries, and partial dictionaries are not expanded into child entries and generally convert to their .NET type name. Add their contents explicitly when a template needs them.
Dictionary<string, string> tokens = message.ToTokenDictionary();
tokens["recipientName"] = customer.DisplayName;
tokens["orderTotal"] = order.Total.ToString("C", culture);
A null message returns a new empty dictionary. Every call returns a new ordinal-keyed dictionary, so modifying it does not modify the message. Property metadata is cached for repeated conversion; property values are read afresh on every call.
Email properties can contain addresses, subject text, and other personal data. Treat the resulting dictionary as message content and avoid logging or persisting it outside the email-processing boundary.
| 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
- Soenneker.Messages.Email (>= 4.0.405)
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 |
|---|---|---|
| 4.0.597 | 0 | 9/5/2026 |
| 4.0.596 | 24 | 9/4/2026 |
| 4.0.595 | 29 | 9/4/2026 |
| 4.0.594 | 194 | 9/1/2026 |
| 4.0.593 | 97 | 8/31/2026 |
| 4.0.592 | 111 | 8/31/2026 |
| 4.0.591 | 133 | 8/31/2026 |
| 4.0.590 | 79 | 8/30/2026 |
| 4.0.589 | 83 | 8/30/2026 |
| 4.0.588 | 87 | 8/30/2026 |
| 4.0.587 | 76 | 8/30/2026 |
| 4.0.586 | 87 | 8/30/2026 |
| 4.0.585 | 79 | 8/30/2026 |
| 4.0.584 | 83 | 8/29/2026 |
| 4.0.582 | 95 | 8/29/2026 |
| 4.0.581 | 81 | 8/26/2026 |
| 4.0.580 | 83 | 8/26/2026 |
| 4.0.579 | 103 | 8/25/2026 |
| 4.0.578 | 88 | 8/22/2026 |
| 4.0.577 | 96 | 8/22/2026 |
Update dependency Soenneker.Messages.Email to 4.0.405 (#1153)