diff options
author | 赵智超 <1012112796@qq.com> | 2020-08-23 23:03:18 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-23 16:03:18 +0100 |
commit | e7d65cbc6e50d70753f7228c46cbff0cffde7eba (patch) | |
tree | b66f497a44ef729a4fc33c3ab2663a958d3e7b0f /modules/notification | |
parent | e429c1164ec68b154b7f06db2c2e04dd25bad094 (diff) | |
download | gitea-e7d65cbc6e50d70753f7228c46cbff0cffde7eba.tar.gz gitea-e7d65cbc6e50d70753f7228c46cbff0cffde7eba.zip |
Add email notify for new release (#12463)
* Add email notify for new release
Signed-off-by: a1012112796 <1012112796@qq.com>
Diffstat (limited to 'modules/notification')
-rw-r--r-- | modules/notification/mail/mail.go | 13 |
1 files changed, 13 insertions, 0 deletions
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) +} |