update
parent
afb7664ebf
commit
df63ab8d5e
|
@ -347,7 +347,22 @@
|
||||||
<br />
|
<br />
|
||||||
{{ if .Sender }}{{.Sender}}{{else}}{{.App.Name}}{{end}}
|
{{ if .Sender }}{{.Sender}}{{else}}{{.App.Name}}{{end}}
|
||||||
</p>
|
</p>
|
||||||
|
{{ with .Actions }}
|
||||||
|
<table class="body-sub">
|
||||||
|
<tbody>
|
||||||
|
{{ range $action := . }}
|
||||||
|
{{if $action.Button.Text}}
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p class="sub">{{$.App.TroubleText | replace "{ACTION}" $action.Button.Text}}</p>
|
||||||
|
<p class="sub"><a href="{{ $action.Button.Link }}">{{ $action.Button.Link }}</a></p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
{{ end }}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -19,6 +19,7 @@ type App struct {
|
||||||
Link string
|
Link string
|
||||||
Logo string
|
Logo string
|
||||||
Copyright string
|
Copyright string
|
||||||
|
TroubleText string
|
||||||
}
|
}
|
||||||
|
|
||||||
type Button struct {
|
type Button struct {
|
||||||
|
|
|
@ -4,6 +4,7 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
_ "embed"
|
_ "embed"
|
||||||
"html/template"
|
"html/template"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/vanng822/go-premailer/premailer"
|
"github.com/vanng822/go-premailer/premailer"
|
||||||
"github.com/yuin/goldmark"
|
"github.com/yuin/goldmark"
|
||||||
|
@ -29,6 +30,9 @@ func init() {
|
||||||
"mul": func(a, b int) int {
|
"mul": func(a, b int) int {
|
||||||
return a * b
|
return a * b
|
||||||
},
|
},
|
||||||
|
"replace": func(from, to, input string) string {
|
||||||
|
return strings.Replace(input, from, to, -1)
|
||||||
|
},
|
||||||
}).Parse(mailTmpl))
|
}).Parse(mailTmpl))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,5 +37,6 @@ func setupDefault() {
|
||||||
time.Now().Year(), app.Name)
|
time.Now().Year(), app.Name)
|
||||||
app.Link = "https://kumoly.io"
|
app.Link = "https://kumoly.io"
|
||||||
app.Logo = "http://www.duchess-france.org/wp-content/uploads/2016/01/gopher.png"
|
app.Logo = "http://www.duchess-france.org/wp-content/uploads/2016/01/gopher.png"
|
||||||
|
app.TroubleText = "If you’re having trouble with the button '{ACTION}', copy and paste the URL below into your web browser."
|
||||||
dial = gomail.NewDialer("mail.kumoly.io", 587, "test@kumoly.io", "test")
|
dial = gomail.NewDialer("mail.kumoly.io", 587, "test@kumoly.io", "test")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue