Skip to content

Latest commit

 

History

History
98 lines (78 loc) · 3.48 KB

README.md

File metadata and controls

98 lines (78 loc) · 3.48 KB

BootstrapEmail.NET


If you know Bootstrap, you know Bootstrap Email.


NuGet

build dotnet

Quality Gate Status

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.

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