1
0
Fork 0
forked from forgejo/forgejo
This commit is contained in:
Sandro Santilli 2016-11-07 17:41:28 +01:00
parent 05fd9d3f09
commit b3828e38a5
3 changed files with 20 additions and 20 deletions

View file

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