https://github.com/w8tcha/bootstrapemail.net
.NET Version of Bootstrap stylesheet, compiler, and inliner for responsive and consistent emails with the Bootstrap syntax you know and love
https://github.com/w8tcha/bootstrapemail.net
bootstrap css email-quirks html-email responsive
Last synced: 11 months ago
JSON representation
.NET Version of Bootstrap stylesheet, compiler, and inliner for responsive and consistent emails with the Bootstrap syntax you know and love
- Host: GitHub
- URL: https://github.com/w8tcha/bootstrapemail.net
- Owner: w8tcha
- License: mit
- Created: 2023-09-30T09:39:23.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-06-29T06:57:02.000Z (11 months ago)
- Last Synced: 2025-06-29T07:37:22.583Z (11 months ago)
- Topics: bootstrap, css, email-quirks, html-email, responsive
- Language: HTML
- Homepage:
- Size: 3.93 MB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.MD
- License: LICENSE.MD
Awesome Lists containing this project
README
# BootstrapEmail.NET
If you know Bootstrap, you know Bootstrap Email.
[](https://nuget.org/packages/BootstrapEmail.Net)
[](https://github.com/w8tcha/BootstrapEmail.Net/actions/workflows/build.yml)
[](https://sonarcloud.io/summary/new_code?id=w8tcha_BootstrapEmail.Net)
This is the .NET Version of [Bootstrap Email](https://github.com/bootstrap-email/bootstrap-email) which was converted from Ruby to .NET (Core) 8/9
Bootstrap Email takes most of its inspiration from these two wonderful frameworks, [Bootstrap](https://getbootstrap.com) and [Tailwind](https://tailwindcss.com) 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
```c#
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
```c#
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
```c#
var bsEmail = new BootstrapEmail();
bsEmail.Compile("emails/*", "mails/compiled/", InputType.Pattern);
```
#### compile for a string
```c#
var bsEmail = new BootstrapEmail();
bsEmail.Compile("Some Button", string.Empty, InputType.String);
```
### Via the command line with the BootstrapEmailNet.Cli:
#### compile all files ending in .html in the current directory
```` cmd
> BootstrapEmail.Cli
````
#### compile the file email.html and save it to the file out.html
```` cmd
> BootstrapEmail.Cli -f email.html -d out.html
````
#### specify a path pattern and a destination directory for compiled emails to be saved to
```` cmd
> BootstrapEmail.Cli -p 'emails/*' -d 'emails/compiled/*'
````
#### compile for a string
```` cmd
> BootstrapEmail.Cli -s 'Some Button'
````
#### specify a config json file to use custom scss files
```` cmd
> BootstrapEmail.Cli -c bootstrap-email.json
````