update
parent
afb7664ebf
commit
df63ab8d5e
|
@ -347,7 +347,22 @@
|
|||
<br />
|
||||
{{ if .Sender }}{{.Sender}}{{else}}{{.App.Name}}{{end}}
|
||||
</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>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
|
@ -19,6 +19,7 @@ type App struct {
|
|||
Link string
|
||||
Logo string
|
||||
Copyright string
|
||||
TroubleText string
|
||||
}
|
||||
|
||||
type Button struct {
|
||||
|
|
|
@ -4,6 +4,7 @@ import (
|
|||
"bytes"
|
||||
_ "embed"
|
||||
"html/template"
|
||||
"strings"
|
||||
|
||||
"github.com/vanng822/go-premailer/premailer"
|
||||
"github.com/yuin/goldmark"
|
||||
|
@ -29,6 +30,9 @@ func init() {
|
|||
"mul": func(a, b int) int {
|
||||
return a * b
|
||||
},
|
||||
"replace": func(from, to, input string) string {
|
||||
return strings.Replace(input, from, to, -1)
|
||||
},
|
||||
}).Parse(mailTmpl))
|
||||
}
|
||||
|
||||
|
|
|
@ -37,5 +37,6 @@ func setupDefault() {
|
|||
time.Now().Year(), app.Name)
|
||||
app.Link = "https://kumoly.io"
|
||||
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")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue