1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2024-12-18 08:26:45 +02:00
woodpecker/plugin/notify/email/template.go

43 lines
1.1 KiB
Go
Raw Normal View History

2014-08-04 00:45:50 +03:00
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>
2014-08-04 00:45:50 +03:00
<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>
2014-08-04 00:45:50 +03:00
<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>
`))