Skip to content

Commit ddd3586

Browse files
zeripathdelvh
andauthored
Fix missing repo link in issue/pull assigned emails (#17183)
There was a mistake in the template file: `templates/mail/issue/assigned.tmpl` where the repourl was generated from a non-existent release instead of the issue. This PR changes this to use the issue but also ensure that the issue repo is loaded. It also slightly improves the English locale string. Fix #17160 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: delvh <dev.lh@web.de>
1 parent ecfac78 commit ddd3586

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

options/locale/locale_en-US.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,8 @@ reset_password.text = Please click the following link to recover your account wi
346346
347347
register_success = Registration successful
348348
349-
issue_assigned.pull = @%[1]s assigned you to the pull request %[2]s in repository %[3]s.
350-
issue_assigned.issue = @%[1]s assigned you to the issue %[2]s in repository %[3]s.
349+
issue_assigned.pull = @%[1]s assigned you to pull request %[2]s in repository %[3]s.
350+
issue_assigned.issue = @%[1]s assigned you to issue %[2]s in repository %[3]s.
351351
352352
issue.x_mentioned_you = <b>@%s</b> mentioned you:
353353
issue.action.force_push = <b>%[1]s</b> force-pushed the <b>%[2]s</b> from %[3]s to %[4]s.

services/mailer/mail.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,12 @@ func SendIssueAssignedMail(issue *models.Issue, doer *models.User, content strin
372372
// No mail service configured
373373
return nil
374374
}
375+
376+
if err := issue.LoadRepo(); err != nil {
377+
log.Error("Unable to load repo [%d] for issue #%d [%d]. Error: %v", issue.RepoID, issue.Index, issue.ID, err)
378+
return err
379+
}
380+
375381
langMap := make(map[string][]*models.User)
376382
for _, user := range recipients {
377383
langMap[user.Language] = append(langMap[user.Language], user)

templates/mail/issue/assigned.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<title>{{.Subject}}</title>
99
</head>
1010

11-
{{$repo_url := printf "<a href='%s'>%s</a>" .Release.Repo.HTMLURL .Release.Repo.FullName}}
11+
{{$repo_url := printf "<a href='%s'>%s</a>" .Issue.Repo.HTMLURL .Issue.Repo.FullName}}
1212
{{$link := printf "<a href='%s'>#%d</a>" .Link .Issue.Index}}
1313
<body>
1414
<p>

0 commit comments

Comments
 (0)