summaryrefslogtreecommitdiffstats
path: root/services/mailer
diff options
context:
space:
mode:
Diffstat (limited to 'services/mailer')
-rw-r--r--services/mailer/mail.go11
-rw-r--r--services/mailer/mail_issue.go4
2 files changed, 9 insertions, 6 deletions
diff --git a/services/mailer/mail.go b/services/mailer/mail.go
index 3f0a789dc4..bc2aff7314 100644
--- a/services/mailer/mail.go
+++ b/services/mailer/mail.go
@@ -28,8 +28,9 @@ const (
mailAuthResetPassword base.TplName = "auth/reset_passwd"
mailAuthRegisterNotify base.TplName = "auth/register_notify"
- mailIssueComment base.TplName = "issue/comment"
- mailIssueMention base.TplName = "issue/mention"
+ mailIssueComment base.TplName = "issue/comment"
+ mailIssueMention base.TplName = "issue/mention"
+ mailIssueAssigned base.TplName = "issue/assigned"
mailNotifyCollaborator base.TplName = "notify/collaborator"
)
@@ -183,6 +184,7 @@ func composeIssueCommentMessage(issue *models.Issue, doer *models.User, content
data = composeTplData(subject, body, issue.HTMLURL())
}
data["Doer"] = doer
+ data["Issue"] = issue
var mailBody bytes.Buffer
@@ -220,3 +222,8 @@ func SendIssueMentionMail(issue *models.Issue, doer *models.User, content string
}
SendAsync(composeIssueCommentMessage(issue, doer, content, comment, mailIssueMention, tos, "issue mention"))
}
+
+// SendIssueAssignedMail composes and sends issue assigned email
+func SendIssueAssignedMail(issue *models.Issue, doer *models.User, content string, comment *models.Comment, tos []string) {
+ SendAsync(composeIssueCommentMessage(issue, doer, content, comment, mailIssueAssigned, tos, "issue assigned"))
+}
diff --git a/services/mailer/mail_issue.go b/services/mailer/mail_issue.go
index b16323909c..a5f3251807 100644
--- a/services/mailer/mail_issue.go
+++ b/services/mailer/mail_issue.go
@@ -10,7 +10,6 @@ import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/references"
- "code.gitea.io/gitea/modules/setting"
"github.com/unknwon/com"
)
@@ -24,9 +23,6 @@ func mailSubject(issue *models.Issue) string {
// 1. Repository watchers and users who are participated in comments.
// 2. Users who are not in 1. but get mentioned in current issue/comment.
func mailIssueCommentToParticipants(issue *models.Issue, doer *models.User, content string, comment *models.Comment, mentions []string) error {
- if !setting.Service.EnableNotifyMail {
- return nil
- }
watchers, err := models.GetWatchers(issue.RepoID)
if err != nil {