Skip to content

Commit

Permalink
fix: mailTitle template
Browse files Browse the repository at this point in the history
  • Loading branch information
j1g5awi committed Apr 10, 2022
1 parent 00ad361 commit 78a40d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func init() {
rootCmd.Flags().IntVar(&smtpPort, "smtp-port", 465, "smtp port")
rootCmd.Flags().StringVar(&smtpUsername, "smtp-username", "", "smtp username")
rootCmd.Flags().StringVar(&smtpPassword, "smtp-password", "", "smtp password")
rootCmd.Flags().StringVar(&mailTitle, "mail-title", "[简悦] - {{ title }}", "mail title")
rootCmd.Flags().StringVar(&mailTitle, "mail-title", "[简悦] - {{title}}", "mail title")
rootCmd.Flags().StringVar(&receiverMail, "receiver-mail", "", "receiver mail")
rootCmd.Flags().StringVar(&kindleMail, "kindle-mail", "", "kindle mail")
rootCmd.Flags().BoolVarP(&checkVersion, "version", "V", false, "check version")
Expand Down Expand Up @@ -331,7 +331,7 @@ func mailHandle(w http.ResponseWriter, r *http.Request) {
return
}
// 这里偷懒直接替换文本
title := strings.ReplaceAll(mailTitle, "{{ title }}", r.Form.Get("title"))
title := strings.ReplaceAll(mailTitle, "{{title}}", r.Form.Get("title"))

content := r.Form.Get("content")
attach := r.Form.Get("attach")
Expand Down

0 comments on commit 78a40d5

Please sign in to comment.