From e7d65cbc6e50d70753f7228c46cbff0cffde7eba Mon Sep 17 00:00:00 2001 From: 赵智超 <1012112796@qq.com> Date: Sun, 23 Aug 2020 23:03:18 +0800 Subject: Add email notify for new release (#12463) * Add email notify for new release Signed-off-by: a1012112796 <1012112796@qq.com> --- modules/notification/mail/mail.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'modules/notification') diff --git a/modules/notification/mail/mail.go b/modules/notification/mail/mail.go index 795c8af2c8..9b2c27280f 100644 --- a/modules/notification/mail/mail.go +++ b/modules/notification/mail/mail.go @@ -145,3 +145,16 @@ func (m *mailNotifier) NotifyPullRequestPushCommits(doer *models.User, pr *model m.NotifyCreateIssueComment(doer, comment.Issue.Repo, comment.Issue, comment) } + +func (m *mailNotifier) NotifyNewRelease(rel *models.Release) { + if err := rel.LoadAttributes(); err != nil { + log.Error("NotifyNewRelease: %v", err) + return + } + + if rel.IsDraft || rel.IsPrerelease { + return + } + + mailer.MailNewRelease(rel) +} -- cgit v1.2.3