Add email notify for new release (#12463)

* Add email notify for new release

Signed-off-by: a1012112796 <1012112796@qq.com>
This commit is contained in:
赵智超 authored and GitHub committed 2020-08-23 16:03:18 +01:00
1 parent e429c1164e
commit e7d65cbc6e
4 files changed
+139

No files matched your search

+13
View File
@@ -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)
}