Soenneker.Extensions.Messages.Email 4.0.591

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Extensions.Messages.Email --version 4.0.591
                    
NuGet\Install-Package Soenneker.Extensions.Messages.Email -Version 4.0.591
                    
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="Soenneker.Extensions.Messages.Email" Version="4.0.591" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Extensions.Messages.Email" Version="4.0.591" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Extensions.Messages.Email" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.Extensions.Messages.Email --version 4.0.591
                    
#r "nuget: Soenneker.Extensions.Messages.Email, 4.0.591"
                    
#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.
#:package Soenneker.Extensions.Messages.Email@4.0.591
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.Extensions.Messages.Email&version=4.0.591
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Extensions.Messages.Email&version=4.0.591
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

alternate text is missing from this package README image 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 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. 
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
4.0.597 0 9/5/2026
4.0.596 40 9/4/2026
4.0.595 33 9/4/2026
4.0.594 195 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 86 8/30/2026
4.0.588 87 8/30/2026
4.0.587 76 8/30/2026
4.0.586 88 8/30/2026
4.0.585 80 8/30/2026
4.0.584 83 8/29/2026
4.0.582 96 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
Loading failed

Update dependency Soenneker.Messages.Email to 4.0.398 (#1133)