BootstrapEmail.Net
1.5.0
See the version list below for details.
dotnet add package BootstrapEmail.Net --version 1.5.0
NuGet\Install-Package BootstrapEmail.Net -Version 1.5.0
<PackageReference Include="BootstrapEmail.Net" Version="1.5.0" />
paket add BootstrapEmail.Net --version 1.5.0
#r "nuget: BootstrapEmail.Net, 1.5.0"
// Install BootstrapEmail.Net as a Cake Addin #addin nuget:?package=BootstrapEmail.Net&version=1.5.0 // Install BootstrapEmail.Net as a Cake Tool #tool nuget:?package=BootstrapEmail.Net&version=1.5.0
BootstrapEmail.NET
If you know Bootstrap, you know Bootstrap Email.
This is the .NET Version of Bootstrap Email which was converted from Ruby to .NET (Core) 7/8
Bootstrap Email takes most of its inspiration from these two wonderful frameworks, Bootstrap and Tailwind but for HTML emails. Working with HTML in emails is never easy because of the nuances of email vs the web. With Bootstrap Email you don't have to understand all the nuance and it allows you to write emails like you would a website.
Runtime
[!CAUTION] By default package contains only the windows x64 Dart Sass runtime. If you have different system then it can use the installed Dart Sass in your system, or you can install one of the following nuget packages:
- DartSass.Native.win-x64
- DartSass.Native.win-x86
- DartSass.Native.linux-x64
- DartSass.Native.linux-arm64
- DartSass.Native.linux-arm
- DartSass.Native.linux-x86
- DartSass.Native.linux-musl-x64
- DartSass.Native.linux-musl-arm64
- DartSass.Native.linux-musl-arm
- DartSass.Native.linux-musl-x86
- DartSass.Native.macos-x64
- DartSass.Native.macos-arm64
- DartSass.Native.android-x64
- DartSass.Native.android-arm64
- DartSass.Native.android-arm
- DartSass.Native.android-x86
Setup
There are a few different ways you can use Bootstrap Email to compile emails:
Use the dll
compile all files ending in .html in the current directory
var bsEmail = new BootstrapEmail();
bsEmail.Compile(string.Empty, string.Empty, InputType.File);
compile the file email.html and save it to the file out.html
var bsEmail = new BootstrapEmail();
bsEmail.Compile("email.html", "out.html", InputType.File);
specify a path pattern and a destination directory for compiled emails to be saved to
var bsEmail = new BootstrapEmail();
bsEmail.Compile("emails/*", "mails/compiled/", InputType.Pattern);
compile for a string
var bsEmail = new BootstrapEmail();
bsEmail.Compile("<a href='#' class='btn btn-primary'>Some Button</a>", string.Empty, InputType.String);
Via the command line with the BootstrapEmailNet.Cli:
compile all files ending in .html in the current directory
> BootstrapEmail.Cli
compile the file email.html and save it to the file out.html
> BootstrapEmail.Cli -f email.html -d out.html
specify a path pattern and a destination directory for compiled emails to be saved to
> BootstrapEmail.Cli -p 'emails/*' -d 'emails/compiled/*'
compile for a string
> BootstrapEmail.Cli -s '<a href="#" class="btn btn-primary">Some Button</a>'
specify a config json file to use custom scss files
> BootstrapEmail.Cli -c bootstrap-email.json
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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. |
-
net7.0
- AngleSharp (>= 1.1.2)
- Citizen17.DartSass (>= 2.3.0)
- DartSass.Native.win-x64 (>= 1.74.1)
- HtmlAgilityPack (>= 1.11.60)
- PreMailer.Net (>= 2.5.0)
-
net8.0
- AngleSharp (>= 1.1.2)
- Citizen17.DartSass (>= 2.3.0)
- DartSass.Native.win-x64 (>= 1.74.1)
- HtmlAgilityPack (>= 1.11.60)
- PreMailer.Net (>= 2.5.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
* Switched form libsass to dartsass as SASS compiler
* Fixed Path issue under Linux