Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 24 days 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 (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-04-25T17:14:33.000Z (28 days ago)
- Last Synced: 2024-04-26T17:59:57.851Z (27 days ago)
- Topics: email, golang, html, inline-css, inline-styles, mail, premailer
- Language: Go
- Homepage:
- Size: 79.1 KB
- Stars: 133
- Watchers: 4
- Forks: 19
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- 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-extra - go-premailer - 02-16T22:19:18Z|2021-03-06T20:26:39Z| (Email / Advanced Console UIs)
- awesome-go - go-premailer - Inline styling for HTML mail in Go. (Email / Search and Analytic Databases)
- 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 / Advanced Console UIs)
- awesome-go-projects - go-premailer - Inline styling for HTML mail in Go. (Email / Standard CLI)
- 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-cn - go-premailer - premailer) (电子邮件 / 检索及分析资料库)
- go-awesome-cn-star - go-premailer
- awesome-go-with-stars - 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)
- repo-1316-awesome-go-cn - go-premailer - premailer) (电子邮件 / 检索及分析资料库)
- repo-1211-awesome-go-cn - go-premailer - premailer) (电子邮件 / 检索及分析资料库)
- awesome-go-zh - go-premailer - premailer) (电子邮件 / 检索及分析资料库)
- awesome-Char - go-premailer - Inline styling for HTML mail in Go. (Email / Advanced Console UIs)
- awesome-reader - 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 / Advanced Console UIs)
- Go-awesome - 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 - 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
- awesome-go-stars - go-premailer(stars: 130) - Inline styling for HTML mail in Go. (Email / Search and Analytic Databases)
- awesome-go-cn - go-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)
README
# go-premailer
Inline styling for HTML mail in golang
# Document
[![Build Status](https://travis-ci.org/vanng822/go-premailer.svg?branch=master)](https://travis-ci.org/vanng822/go-premailer)
[![GoDoc](https://godoc.org/github.com/vanng822/go-premailer/premailer?status.svg)](https://godoc.org/github.com/vanng822/go-premailer/premailer)
[![GoCover](http://gocover.io/_badge/github.com/vanng822/go-premailer/premailer)](http://gocover.io/github.com/vanng822/go-premailer/premailer)
[![Go Report Card](https://goreportcard.com/badge/github.com/vanng822/go-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# Demo
http://premailer.isgoodness.com/
# Conversion endpoint
http://premailer.isgoodness.com/convert
request POST:
html: your mail
cssToAttributes: true|false
removeClasses: true|false
response:
{result: output}