Skip to content

Commit f0519f4

Browse files
committed
Add missing mail notification
1 parent b6d8389 commit f0519f4

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

modules/notification/mail/mail.go

+12
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"fmt"
99

1010
"code.gitea.io/gitea/models"
11+
"code.gitea.io/gitea/modules/git"
1112
"code.gitea.io/gitea/modules/log"
1213
"code.gitea.io/gitea/modules/notification/base"
1314
"code.gitea.io/gitea/services/mailer"
@@ -98,3 +99,14 @@ func (m *mailNotifier) NotifyIssueChangeAssignee(doer *models.User, issue *model
9899
mailer.SendIssueAssignedMail(issue, doer, ct, comment, []string{assignee.Email})
99100
}
100101
}
102+
103+
func (m *mailNotifier) NotifyMergePullRequest(pr *models.PullRequest, doer *models.User, baseRepo *git.Repository) {
104+
if err := pr.LoadIssue(); err != nil {
105+
log.Error("pr.LoadIssue: %v", err)
106+
return
107+
}
108+
109+
if err := mailer.MailParticipants(pr.Issue, doer, models.ActionClosePullRequest); err != nil {
110+
log.Error("MailParticipants: %v", err)
111+
}
112+
}

routers/repo/pull.go

-2
Original file line numberDiff line numberDiff line change
@@ -716,8 +716,6 @@ func MergePullRequest(ctx *context.Context, form auth.MergePullRequestForm) {
716716
return
717717
}
718718

719-
notification.NotifyMergePullRequest(pr, ctx.User, ctx.Repo.GitRepo)
720-
721719
log.Trace("Pull request merged: %d", pr.ID)
722720
ctx.Redirect(ctx.Repo.RepoLink + "/pulls/" + com.ToStr(pr.Index))
723721
}

0 commit comments

Comments
 (0)