diff options
author | Győrvári Gábor <scr34m@gmail.com> | 2017-06-23 15:43:37 +0200 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-06-23 21:43:37 +0800 |
commit | f2afed3098973eb70ecf61c7e3bf7203bf3f592a (patch) | |
tree | 04b62b92a0efb24c26e711478010f9f46b7b973c /models/issue_mail.go | |
parent | 09cb9991458dd56e2ac5df22b82ead563dbaa50f (diff) | |
download | gitea-f2afed3098973eb70ecf61c7e3bf7203bf3f592a.tar.gz gitea-f2afed3098973eb70ecf61c7e3bf7203bf3f592a.zip |
Enable assignee e-mail notification (#2003)
* Enable assignee e-mail notification
* Check assignee and doer to avoid self made comment notifications.
* Assignee not always defined
* New method to avoid error when assignee deleted
* Assignee empty check
Diffstat (limited to 'models/issue_mail.go')
-rw-r--r-- | models/issue_mail.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/models/issue_mail.go b/models/issue_mail.go index 615aa82f06..b9e1a69fc2 100644 --- a/models/issue_mail.go +++ b/models/issue_mail.go @@ -42,6 +42,11 @@ func mailIssueCommentToParticipants(issue *Issue, doer *User, comment *Comment, participants = append(participants, issue.Poster) } + // Assignee must receive any communications + if issue.Assignee != nil && issue.AssigneeID > 0 && issue.AssigneeID != doer.ID { + participants = append(participants, issue.Assignee) + } + tos := make([]string, 0, len(watchers)) // List of email addresses. names := make([]string, 0, len(watchers)) for i := range watchers { |