增加新的发邮件方法
This commit is contained in:
parent
35a75ea21e
commit
9100303a3b
12
mail/mail.go
12
mail/mail.go
@ -82,3 +82,15 @@ func (m *Mail) TplSend(mailTo []string, subject string, tpl string, bindData map
|
||||
}
|
||||
return m.BaseSend(mailTo, subject, mailBody)
|
||||
}
|
||||
|
||||
// TplContentSend 使用模版发送邮件
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 1:05 下午 2021/8/14
|
||||
func (m *Mail) TplContentSend(mailTo []string, subject string, tplContent string, bindData map[string]string) error {
|
||||
for k, v := range bindData {
|
||||
tplContent = strings.ReplaceAll(tplContent, "{"+k+"}", v)
|
||||
}
|
||||
return m.BaseSend(mailTo, subject, tplContent)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user