feat: support dingtalk push

This commit is contained in:
engigu
2024-01-06 17:44:45 +08:00
parent 2730bb97ca
commit e6f7c2c64e
26 changed files with 418 additions and 121 deletions
+3 -3
View File
@@ -12,7 +12,7 @@ type EmailService struct {
}
// SendTaskEmail 执行发送邮件
func (s *EmailService) SendTaskEmail(auth send_way_service.WayDetailEmail, ins models.SendTasksIns, typeC string, content string) string {
func (s *EmailService) SendTaskEmail(auth send_way_service.WayDetailEmail, ins models.SendTasksIns, typeC string, title string, content string) string {
insService := send_ins_service.SendTaskInsService{}
errStr, c := insService.ValidateDiffIns(ins)
if errStr != "" {
@@ -27,9 +27,9 @@ func (s *EmailService) SendTaskEmail(auth send_way_service.WayDetailEmail, ins m
errMsg := ""
emailer.Init(auth.Server, auth.Port, auth.Account, auth.Passwd)
if typeC == "text" {
errMsg = emailer.SendTextMessage(config.ToAccount, config.Title, content)
errMsg = emailer.SendTextMessage(config.ToAccount, title, content)
} else if typeC == "html" {
errMsg = emailer.SendHtmlMessage(config.ToAccount, config.Title, content)
errMsg = emailer.SendHtmlMessage(config.ToAccount, title, content)
} else {
errMsg = fmt.Sprintf("未知的邮件发送内容类型:%s", ins.ContentType)
}