您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

21 行
550 B

package service
import "github.com/unknwon/goconfig"
func SendMessage(conf *goconfig.ConfigFile,title,msg string) error {
if conf.MustValue("messenger","enable","false")=="true" {
//邮件发送
if conf.MustValue("messenger","type","none")=="smtp" {
email:=NewEmail(conf)
err:=email.Send([]string{conf.MustValue("messenger","email","")},title,msg)
return err
}
//Server酱推送
if conf.MustValue("messenger","type","none")=="wechat" {
wechat:=NewWechat(conf)
err:=wechat.Send(title,msg)
return err
}
}
return nil
}