增加新的发邮件方法

This commit is contained in:
白茶清欢 2021-08-14 21:20:46 +08:00
parent 35a75ea21e
commit 9100303a3b

View File

@ -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)
}