From 41efc66d25dea6139754d8a90fa15b0d7b128111 Mon Sep 17 00:00:00 2001 From: joyexpr Date: Mon, 19 Apr 2021 23:57:20 +0800 Subject: [PATCH] fix: send mail not work(wrong notifyType and subject) (#660) --- src/modules/server/notify/notify.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/server/notify/notify.go b/src/modules/server/notify/notify.go index 9debe58f..df75e66d 100644 --- a/src/modules/server/notify/notify.go +++ b/src/modules/server/notify/notify.go @@ -420,8 +420,8 @@ func send(tos []string, content, subject, notifyType string) error { return fmt.Errorf("content is blank") } - if notifyType == "email" { - message.Subject = strings.TrimSpace(message.Subject) + if notifyType == "mail" { + message.Subject = strings.TrimSpace(subject) if message.Subject == "" { return fmt.Errorf("subject is blank") } @@ -432,7 +432,7 @@ func send(tos []string, content, subject, notifyType string) error { redisc.Write(&message, cron.VOICE_QUEUE_NAME) case "sms": redisc.Write(&message, cron.SMS_QUEUE_NAME) - case "email": + case "mail": redisc.Write(&message, cron.MAIL_QUEUE_NAME) case "im": redisc.Write(&message, cron.IM_QUEUE_NAME)