summaryrefslogtreecommitdiffstats
path: root/modules/notification/mail
diff options
context:
space:
mode:
authorJimmy Praet <jimmy.praet@telenet.be>2021-06-23 06:14:22 +0200
committerGitHub <noreply@github.com>2021-06-23 00:14:22 -0400
commit17030ced75059ec21f6fb1945a751c3ebef29a32 (patch)
tree6d7d79c766335728961e02eb80da4ae08fbf7d9b /modules/notification/mail
parent66f8da538a8b1bd63ea1a0f97202ee0d46c15c4f (diff)
downloadgitea-17030ced75059ec21f6fb1945a751c3ebef29a32.tar.gz
gitea-17030ced75059ec21f6fb1945a751c3ebef29a32.zip
Improve notifications for WIP draft PR's (#14663)
* #14559 Reduce amount of email notifications for WIP draft PR's don't notify repo watchers of WIP draft PR's * #13190 Notification when WIP Pull Request is ready for review * Send email notification to repo watchers when WIP PR is created * Send ui notification to repo watchers when WIP PR is created * send specific email notification when PR is marked ready for review instead of reusing the CreatePullRequest action * Fix lint error Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'modules/notification/mail')
-rw-r--r--modules/notification/mail/mail.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/notification/mail/mail.go b/modules/notification/mail/mail.go
index 0927e182c1..5bfb0b3ef8 100644
--- a/modules/notification/mail/mail.go
+++ b/modules/notification/mail/mail.go
@@ -73,6 +73,18 @@ func (m *mailNotifier) NotifyIssueChangeStatus(doer *models.User, issue *models.
}
}
+func (m *mailNotifier) NotifyIssueChangeTitle(doer *models.User, issue *models.Issue, oldTitle string) {
+ if err := issue.LoadPullRequest(); err != nil {
+ log.Error("issue.LoadPullRequest: %v", err)
+ return
+ }
+ if issue.IsPull && models.HasWorkInProgressPrefix(oldTitle) && !issue.PullRequest.IsWorkInProgress() {
+ if err := mailer.MailParticipants(issue, doer, models.ActionPullRequestReadyForReview, nil); err != nil {
+ log.Error("MailParticipants: %v", err)
+ }
+ }
+}
+
func (m *mailNotifier) NotifyNewPullRequest(pr *models.PullRequest, mentions []*models.User) {
if err := mailer.MailParticipants(pr.Issue, pr.Issue.Poster, models.ActionCreatePullRequest, mentions); err != nil {
log.Error("MailParticipants: %v", err)