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:
赵智超 2020-08-23 23:03:18 +08:00 committed by GitHub
parent e429c1164e
commit e7d65cbc6e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 139 additions and 0 deletions

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)
}