Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit 8922196

Browse files
committed
Check notification type before sending smtp message
1 parent c8c5dad commit 8922196

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

api/notifier.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ func (notifier *smtpNotifier) notify(n interface{}) error {
8585
"%s\r\n",
8686
}, "\r\n")
8787
head, body := notifications.Describe(n)
88+
if head == "" || body == "" {
89+
return nil
90+
}
8891
conf := notifier.settings
8992
data := fmt.Sprintf(template, conf.SenderEmail, conf.RecipientEmail, head, body)
9093
return sendEmail(notifier.settings, []byte(data))

0 commit comments

Comments
 (0)