mirror of
https://github.com/gogs/gogs.git
synced 2025-05-31 11:42:13 +00:00
models/issue_mail: add assignee to issue related emails (#5628)
Reference #4220
This commit is contained in:
parent
8b383f86de
commit
e19c026083
@ -92,7 +92,7 @@ func NewMailerIssue(issue *Issue) mailer.Issue {
|
||||
|
||||
// mailIssueCommentToParticipants can be used for both new issue creation and comment.
|
||||
// This functions sends two list of emails:
|
||||
// 1. Repository watchers and users who are participated in comments.
|
||||
// 1. Repository watchers, users who participated in comments and the assignee.
|
||||
// 2. Users who are not in 1. but get mentioned in current issue/comment.
|
||||
func mailIssueCommentToParticipants(issue *Issue, doer *User, mentions []string) error {
|
||||
if !setting.Service.EnableNotifyMail {
|
||||
@ -142,6 +142,12 @@ func mailIssueCommentToParticipants(issue *Issue, doer *User, mentions []string)
|
||||
tos = append(tos, participants[i].Email)
|
||||
names = append(names, participants[i].Name)
|
||||
}
|
||||
if issue.Assignee != nil && issue.Assignee.ID != doer.ID {
|
||||
if !com.IsSliceContainsStr(names, issue.Assignee.Name) {
|
||||
tos = append(tos, issue.Assignee.Email)
|
||||
names = append(names, issue.Assignee.Name)
|
||||
}
|
||||
}
|
||||
mailer.SendIssueCommentMail(NewMailerIssue(issue), NewMailerRepo(issue.Repo), NewMailerUser(doer), tos)
|
||||
|
||||
// Mail mentioned people and exclude watchers.
|
||||
|
Loading…
x
Reference in New Issue
Block a user