https://github.com/vanng822/go-premailer
Inline styling for html mail in golang
https://github.com/vanng822/go-premailer
email golang html inline-css inline-styles mail premailer
Last synced: 11 months ago
JSON representation
Inline styling for html mail in golang
- Host: GitHub
- URL: https://github.com/vanng822/go-premailer
- Owner: vanng822
- License: mit
- Created: 2015-02-16T22:19:18.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2024-07-08T23:56:31.000Z (over 1 year ago)
- Last Synced: 2024-07-31T20:51:17.133Z (over 1 year ago)
- Topics: email, golang, html, inline-css, inline-styles, mail, premailer
- Language: Go
- Homepage:
- Size: 113 KB
- Stars: 136
- Watchers: 4
- Forks: 19
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go-cn - go-premailer
- awesome-go-extra - go-premailer - 02-16T22:19:18Z|2021-03-06T20:26:39Z| (Email / Advanced Console UIs)
- awesome-go - vanng822/go-premailer
- fucking-awesome-go - go-premailer - Inline styling for HTML mail in Go. (Email / Search and Analytic Databases)
- awesome-go - go-premailer - Inline styling for HTML mail in Go. (Email / Search and Analytic Databases)
- awesome-go - go-premailer - Inline styling for HTML mail in Go. (Email / Search and Analytic Databases)
- awesome-go - go-premailer - | - | - | (Email / Advanced Console UIs)
- awesome-go - go-premailer - Inline styling for HTML mail in Go. (Email / Search and Analytic Databases)
- awesome-go - go-premailer - Inline styling for HTML mail in Go. (Email / Advanced Console UIs)
- awesome-go-cn - go-premailer - premailer) (电子邮件 / 检索及分析资料库)
- awesome-go-cn - go-premailer - premailer) (电子邮件 / 检索及分析资料库)
- awesome-go - go-premailer - Inline styling for HTML mail in Go. (Email / Search and Analytic Databases)
- awesome-go - go-premailer - Inline styling for HTML mail in Go. (Email / Search and Analytic Databases)
- awesome-go-with-stars - go-premailer - 02-14 | (Email / Search and Analytic Databases)
- awesome-Char - go-premailer - Inline styling for HTML mail in Go. (Email / Advanced Console UIs)
- awesome-go - go-premailer - Inline styling for HTML mail in Go. (Email / Search and Analytic Databases)
- go-awesome-with-star-updatetime - go-premailer - Inline styling for HTML mail in Go. (Email / Advanced Console UIs)
- awesome-go-plus - go-premailer - Inline styling for HTML mail in Go.  (Email / Search and Analytic Databases)
- awesome-go-info - go-premailer
README
# go-premailer
Inline styling for HTML mail in golang
# Document
[](https://godoc.org/github.com/vanng822/go-premailer/premailer)
[](https://goreportcard.com/report/github.com/vanng822/go-premailer)
# install
go get github.com/vanng822/go-premailer/premailer
# Example
import (
"fmt"
"github.com/vanng822/go-premailer/premailer"
"log"
)
func main() {
prem, err := premailer.NewPremailerFromFile(inputFile, premailer.NewOptions())
if err != nil {
log.Fatal(err)
}
html, err := prem.Transform()
if err != nil {
log.Fatal(err)
}
fmt.Println(html)
}
## Input
Title
h1 { width: 300px; color:red; }
strong { text-decoration:none; }
Hi!
Yes!
## Output
Title
Hi!
Yes!
# Commandline
> go run main.go -i your_email.html
> go run main.go -i your_mail.html -o process_mail.html