Skip to content

Commit

Permalink
fix: mail title
Browse files Browse the repository at this point in the history
  • Loading branch information
j1g5awi committed Apr 8, 2022
1 parent 1918954 commit c2e913a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ func mailHandle(w http.ResponseWriter, r *http.Request) {
}
// 这里偷懒直接替换文本
title := strings.ReplaceAll(config.title, "{{ title }}", r.Form.Get("title"))
log.Print(title)
content := r.Form.Get("content")
attach := r.Form.Get("attach")

Expand All @@ -207,7 +208,7 @@ func mailHandle(w http.ResponseWriter, r *http.Request) {
m := gomail.NewMessage()
m.SetHeader("From", config.username)
m.SetHeader("To", config.receiverMail)
m.SetHeader("Subject", fmt.Sprintf(config.title, title))
m.SetHeader("Subject", title)
m.SetBody("text/html", content)

var attachPath string
Expand Down

0 comments on commit c2e913a

Please sign in to comment.