@@ -118,17 +118,25 @@ func mailIssueCommentToParticipants(e Engine, issue *Issue, doer *User, content
118
118
119
119
// MailParticipants sends new issue thread created emails to repository watchers
120
120
// and mentioned people.
121
- func (issue * Issue ) MailParticipants () (err error ) {
122
- return issue .mailParticipants (x )
121
+ func (issue * Issue ) MailParticipants (opType ActionType ) (err error ) {
122
+ return issue .mailParticipants (x , opType )
123
123
}
124
124
125
- func (issue * Issue ) mailParticipants (e Engine ) (err error ) {
125
+ func (issue * Issue ) mailParticipants (e Engine , opType ActionType ) (err error ) {
126
126
mentions := markup .FindAllMentions (issue .Content )
127
127
if err = UpdateIssueMentions (e , issue .ID , mentions ); err != nil {
128
128
return fmt .Errorf ("UpdateIssueMentions [%d]: %v" , issue .ID , err )
129
129
}
130
130
131
- if err = mailIssueCommentToParticipants (e , issue , issue .Poster , issue .Content , nil , mentions ); err != nil {
131
+ var content = issue .Content
132
+ switch opType {
133
+ case ActionCloseIssue , ActionClosePullRequest :
134
+ content = fmt .Sprintf ("Closed #%d" , issue .Index )
135
+ case ActionReopenIssue , ActionReopenPullRequest :
136
+ content = fmt .Sprintf ("Reopened #%d" , issue .Index )
137
+ }
138
+
139
+ if err = mailIssueCommentToParticipants (e , issue , issue .Poster , content , nil , mentions ); err != nil {
132
140
log .Error (4 , "mailIssueCommentToParticipants: %v" , err )
133
141
}
134
142
0 commit comments