diff --git a/modules/notification/mail/mail.go b/modules/notification/mail/mail.go index 5148434dca..6cc6fda14b 100644 --- a/modules/notification/mail/mail.go +++ b/modules/notification/mail/mail.go @@ -53,6 +53,7 @@ func (m *mailNotifier) NotifyNewIssue(issue *models.Issue) { func (m *mailNotifier) NotifyIssueChangeStatus(doer *models.User, issue *models.Issue, actionComment *models.Comment, isClosed bool) { var actionType models.ActionType + issue.Content = "" if issue.IsPull { if isClosed { actionType = models.ActionClosePullRequest @@ -105,7 +106,7 @@ func (m *mailNotifier) NotifyMergePullRequest(pr *models.PullRequest, doer *mode log.Error("pr.LoadIssue: %v", err) return } - + pr.Issue.Content = "" if err := mailer.MailParticipants(pr.Issue, doer, models.ActionMergePullRequest); err != nil { log.Error("MailParticipants: %v", err) } diff --git a/services/mailer/mail.go b/services/mailer/mail.go index a8768de6cd..fa40170d46 100644 --- a/services/mailer/mail.go +++ b/services/mailer/mail.go @@ -177,7 +177,6 @@ func composeIssueCommentMessages(ctx *mailCommentContext, tos []string, fromMent commentType := models.CommentTypeComment if ctx.Comment != nil { - prefix = "Re: " commentType = ctx.Comment.Type link = ctx.Issue.HTMLURL() + "#" + ctx.Comment.HashTag() } else { @@ -189,13 +188,16 @@ func composeIssueCommentMessages(ctx *mailCommentContext, tos []string, fromMent reviewType = ctx.Comment.Review.Type } - fallback = prefix + fallbackMailSubject(ctx.Issue) - // This is the body of the new issue or comment, not the mail body body := string(markup.RenderByType(markdown.MarkupName, []byte(ctx.Content), ctx.Issue.Repo.HTMLURL(), ctx.Issue.Repo.ComposeMetas())) actType, actName, tplName := actionToTemplate(ctx.Issue, ctx.ActionType, commentType, reviewType) + if actName != "new" { + prefix = "Re: " + } + fallback = prefix + fallbackMailSubject(ctx.Issue) + if ctx.Comment != nil && ctx.Comment.Review != nil { reviewComments = make([]*models.Comment, 0, 10) for _, lines := range ctx.Comment.Review.CodeComments { @@ -247,7 +249,7 @@ func composeIssueCommentMessages(ctx *mailCommentContext, tos []string, fromMent msg.Info = fmt.Sprintf("Subject: %s, %s", subject, info) // Set Message-ID on first message so replies know what to reference - if ctx.Comment == nil { + if actName == "new" { msg.SetHeader("Message-ID", "<"+ctx.Issue.ReplyReference()+">") } else { msg.SetHeader("In-Reply-To", "<"+ctx.Issue.ReplyReference()+">") diff --git a/templates/mail/issue/assigned.tmpl b/templates/mail/issue/assigned.tmpl index 997e2447fc..d302a16f26 100644 --- a/templates/mail/issue/assigned.tmpl +++ b/templates/mail/issue/assigned.tmpl @@ -1,17 +1,21 @@
+@{{.Doer.Name}} assigned you to the {{if .IsPull}}pull request{{else}}issue{{end}} #{{.Issue.Index}} in repository {{.Repo}}.
-
- ---
-
- View it on {{AppName}}.
-