woodpecker/plugin/notify/email/template.go
Brad Rydzewski 6f3997f4e1 moved IRC and Webhooks to their own packages
updated email template to include link to build
updated readme to include correct badge
2014-09-09 23:19:04 -07:00

42 lines
1.1 KiB
Go

package email
import (
"html/template"
)
// raw email message template
var rawMessage = `From: %s
To: %s
Subject: %s
MIME-version: 1.0
Content-Type: text/html; charset="UTF-8"
%s`
// default success email template
var successTemplate = template.Must(template.New("_").Parse(`
<p>
<b>Build was Successful</b>
(<a href="{{.Host}}/{{.Repo.Host}}/{{.Repo.Owner}}/{{.Repo.Name}}/{{.Commit.Branch}}/{{.Commit.Sha}}">see results</a>)
</p>
<p>Repository : {{.Repo.Owner}}/{{.Repo.Name}}</p>
<p>Commit : {{.Commit.ShaShort}}</p>
<p>Author : {{.Commit.Author}}</p>
<p>Branch : {{.Commit.Branch}}</p>
<p>Message:</p>
<p>{{ .Commit.Message }}</p>
`))
// default failure email template
var failureTemplate = template.Must(template.New("_").Parse(`
<p>
<b>Build Failed</b>
(<a href="{{.Host}}/{{.Repo.Host}}/{{.Repo.Owner}}/{{.Repo.Name}}/{{.Commit.Branch}}/{{.Commit.Sha}}">see results</a>)
</p>
<p>Repository : {{.Repo.Owner}}/{{.Repo.Name}}</p>
<p>Commit : {{.Commit.ShaShort}}</p>
<p>Author : {{.Commit.Author}}</p>
<p>Branch : {{.Commit.Branch}}</p>
<p>Message:</p>
<p>{{ .Commit.Message }}</p>
`))