Merge pull request #7 from drone-plugins/feature/premailer

Added premailer to inline all css rules
This commit is contained in:
Thomas Boerger 2016-02-03 10:55:47 +01:00
commit 4001636097

View file

@ -3,6 +3,7 @@ package main
import (
"crypto/tls"
"github.com/aymerick/douceur/inliner"
"github.com/drone/drone-go/drone"
"github.com/drone/drone-go/template"
"github.com/go-gomail/gomail"
@ -42,7 +43,7 @@ func build(payload *drone.Payload, context *Context) (string, string, string, er
return "", "", "", err
}
html, err := template.RenderTrim(
body, err := template.RenderTrim(
context.Vargs.Template,
payload,
)
@ -51,6 +52,12 @@ func build(payload *drone.Payload, context *Context) (string, string, string, er
return "", "", "", err
}
html, err := inliner.Inline(body)
if err != nil {
return "", "", "", err
}
plain, err := html2text.FromString(
html,
)