MailStencil.Scriban 0.1.0-preview.1

This is a prerelease version of MailStencil.Scriban.
dotnet add package MailStencil.Scriban --version 0.1.0-preview.1
                    
NuGet\Install-Package MailStencil.Scriban -Version 0.1.0-preview.1
                    
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="MailStencil.Scriban" Version="0.1.0-preview.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MailStencil.Scriban" Version="0.1.0-preview.1" />
                    
Directory.Packages.props
<PackageReference Include="MailStencil.Scriban" />
                    
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 MailStencil.Scriban --version 0.1.0-preview.1
                    
#r "nuget: MailStencil.Scriban, 0.1.0-preview.1"
                    
#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 MailStencil.Scriban@0.1.0-preview.1
                    
#: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=MailStencil.Scriban&version=0.1.0-preview.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=MailStencil.Scriban&version=0.1.0-preview.1&prerelease
                    
Install as a Cake Tool

MailStencil.Scriban

Scriban 7.4.0 rendering and AST validation for declared .NET model contracts.

services.AddMailStencil().AddScribanRenderer();

var content = new EmailTemplateContent("Hello {{ customer_name }}", textBody: "Welcome!");
var validation = await validator.ValidateAsync<CustomerModel>(content, cancellationToken);
if (validation.IsValid)
{
    var rendered = await renderer.RenderAsync(content, model, CultureInfo.InvariantCulture, cancellationToken);
}

Resolve ITemplateValidator and ITemplateRenderer through DI. Default naming is Scriban snake_case. Only declared public readable properties and typed collections are projected into detached script objects/arrays; methods and runtime subtype additions are unavailable. Validation and rendering share one internal model schema. No storage access, fallback, caching or email sending is implemented.

The supported language is intentionally restricted: no include, eval, dynamic invocation, CLR method access, or model mutation. MailStencil does not automatically HTML-escape values; use html.escape for untrusted values inserted into an HTML body.

See the MailStencil repository for complete setup, storage-provider registration, security limits, and samples.

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
0.1.0-preview.1 0 9/10/2026

First public preview candidate of MailStencil's read-only runtime, renderer, and storage providers.