|
|
@ -23,12 +23,12 @@ const ( |
|
|
|
MailAuthActivate base.TplName = "auth/activate" |
|
|
|
MailAuthActivate base.TplName = "auth/activate" |
|
|
|
MailAuthActivateEmail base.TplName = "auth/activate_email" |
|
|
|
MailAuthActivateEmail base.TplName = "auth/activate_email" |
|
|
|
MailAuthResetPassword base.TplName = "auth/reset_passwd" |
|
|
|
MailAuthResetPassword base.TplName = "auth/reset_passwd" |
|
|
|
MAIL_AUTH_REGISTER_NOTIFY base.TplName = "auth/register_notify" |
|
|
|
MailAuthRegisterNotify base.TplName = "auth/register_notify" |
|
|
|
|
|
|
|
|
|
|
|
MAIL_ISSUE_COMMENT base.TplName = "issue/comment" |
|
|
|
MailIssueComment base.TplName = "issue/comment" |
|
|
|
MAIL_ISSUE_MENTION base.TplName = "issue/mention" |
|
|
|
MailIssueMention base.TplName = "issue/mention" |
|
|
|
|
|
|
|
|
|
|
|
MAIL_NOTIFY_COLLABORATOR base.TplName = "notify/collaborator" |
|
|
|
MailNotifyCollaborator base.TplName = "notify/collaborator" |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
type MailRender interface { |
|
|
|
type MailRender interface { |
|
|
@ -109,7 +109,7 @@ func SendRegisterNotifyMail(c *macaron.Context, u *User) { |
|
|
|
data := map[string]interface{}{ |
|
|
|
data := map[string]interface{}{ |
|
|
|
"Username": u.DisplayName(), |
|
|
|
"Username": u.DisplayName(), |
|
|
|
} |
|
|
|
} |
|
|
|
body, err := mailRender.HTMLString(string(MAIL_AUTH_REGISTER_NOTIFY), data) |
|
|
|
body, err := mailRender.HTMLString(string(MailAuthRegisterNotify), data) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
log.Error(3, "HTMLString: %v", err) |
|
|
|
log.Error(3, "HTMLString: %v", err) |
|
|
|
return |
|
|
|
return |
|
|
@ -131,7 +131,7 @@ func SendCollaboratorMail(u, doer *User, repo *Repository) { |
|
|
|
"RepoName": repoName, |
|
|
|
"RepoName": repoName, |
|
|
|
"Link": repo.HTMLURL(), |
|
|
|
"Link": repo.HTMLURL(), |
|
|
|
} |
|
|
|
} |
|
|
|
body, err := mailRender.HTMLString(string(MAIL_NOTIFY_COLLABORATOR), data) |
|
|
|
body, err := mailRender.HTMLString(string(MailNotifyCollaborator), data) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
log.Error(3, "HTMLString: %v", err) |
|
|
|
log.Error(3, "HTMLString: %v", err) |
|
|
|
return |
|
|
|
return |
|
|
@ -171,7 +171,7 @@ func SendIssueCommentMail(issue *Issue, doer *User, tos []string) { |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
mailer.SendAsync(composeIssueMessage(issue, doer, MAIL_ISSUE_COMMENT, tos, "issue comment")) |
|
|
|
mailer.SendAsync(composeIssueMessage(issue, doer, MailIssueComment, tos, "issue comment")) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// SendIssueMentionMail composes and sends issue mention emails to target receivers.
|
|
|
|
// SendIssueMentionMail composes and sends issue mention emails to target receivers.
|
|
|
@ -179,5 +179,5 @@ func SendIssueMentionMail(issue *Issue, doer *User, tos []string) { |
|
|
|
if len(tos) == 0 { |
|
|
|
if len(tos) == 0 { |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
mailer.SendAsync(composeIssueMessage(issue, doer, MAIL_ISSUE_MENTION, tos, "issue mention")) |
|
|
|
mailer.SendAsync(composeIssueMessage(issue, doer, MailIssueMention, tos, "issue mention")) |
|
|
|
} |
|
|
|
} |
|
|
|