Feat: user register / send activate email

This commit is contained in:
HFO4
2020-02-21 15:15:14 +08:00
parent 7c07b623f6
commit 81d6988a50
8 changed files with 126 additions and 9 deletions

View File

@@ -19,3 +19,17 @@ func NewOveruseNotification(userName, reason string) (string, string) {
return fmt.Sprintf("【%s】空间容量超额提醒", options["siteName"]),
util.Replace(replace, options["over_used_template"])
}
// NewActivationEmail 新建激活邮件
func NewActivationEmail(userName, activateURL string) (string, string) {
options := model.GetSettingByNames("siteName", "siteURL", "siteTitle", "mail_activation_template")
replace := map[string]string{
"{siteTitle}": options["siteName"],
"{userName}": userName,
"{activationUrl}": activateURL,
"{siteUrl}": options["siteURL"],
"{siteSecTitle}": options["siteTitle"],
}
return fmt.Sprintf("【%s】注册激活", options["siteName"]),
util.Replace(replace, options["mail_activation_template"])
}