You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.2 KiB
36 lines
1.2 KiB
package email
|
|
|
|
import (
|
|
"fmt"
|
|
model "github.com/HFO4/cloudreve/models"
|
|
"github.com/HFO4/cloudreve/pkg/util"
|
|
)
|
|
|
|
// NewOveruseNotification 新建超额提醒邮件
|
|
func NewOveruseNotification(userName, reason string) (string, string) {
|
|
options := model.GetSettingByNames("siteName", "siteURL", "siteTitle", "over_used_template")
|
|
replace := map[string]string{
|
|
"{siteTitle}": options["siteName"],
|
|
"{userName}": userName,
|
|
"{notifyReason}": reason,
|
|
"{siteUrl}": options["siteURL"],
|
|
"{siteSecTitle}": options["siteTitle"],
|
|
}
|
|
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"])
|
|
}
|