Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing repo link in issue/pull assigned emails (#17183) #17184

Merged
merged 2 commits into from
Sep 29, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions options/locale/locale_en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,8 @@ reset_password.text = Please click the following link to recover your account wi

register_success = Registration successful

issue_assigned.pull = @%[1]s assigned you to the pull request %[2]s in repository %[3]s.
issue_assigned.issue = @%[1]s assigned you to the issue %[2]s in repository %[3]s.
issue_assigned.pull = @%[1]s assigned you to pull request %[2]s in repository %[3]s.
issue_assigned.issue = @%[1]s assigned you to issue %[2]s in repository %[3]s.

issue.x_mentioned_you = <b>@%s</b> mentioned you:
issue.action.force_push = <b>%[1]s</b> force-pushed the <b>%[2]s</b> from %[3]s to %[4]s.
Expand Down
2 changes: 1 addition & 1 deletion options/locale/locale_ru-RU.ini
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ reset_password.text=Пожалуйста, перейдите по ссылке,

register_success=Регистрация прошла успешно

issue_assigned.pull=@%[1] назначил вам запрос на слияние %[2] в репозитории %[3].
issue_assigned.pull=@%[1]s назначил вам запрос на слияние %[2]s в репозитории %[3]s.
issue_assigned.issue=@%[1]s назначил вам задачу %[2]s в репозитории %[3]s.

issue.x_mentioned_you=<b>@%s</b> упомянул вас:
Expand Down
10 changes: 10 additions & 0 deletions services/mailer/mail.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,16 @@ func sanitizeSubject(subject string) string {

// SendIssueAssignedMail composes and sends issue assigned email
func SendIssueAssignedMail(issue *models.Issue, doer *models.User, content string, comment *models.Comment, recipients []*models.User) error {
if setting.MailService == nil {
// No mail service configured
return nil
}

if err := issue.LoadRepo(); err != nil {
log.Error("Unable to load rep [%d] for issue #%d [%d]. Error: %v", issue.RepoID, issue.Index, issue.ID, err)
6543 marked this conversation as resolved.
Show resolved Hide resolved
return err
}

langMap := make(map[string][]*models.User)
for _, user := range recipients {
langMap[user.Language] = append(langMap[user.Language], user)
Expand Down
2 changes: 1 addition & 1 deletion templates/mail/issue/assigned.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<title>{{.Subject}}</title>
</head>

{{$repo_url := printf "<a href='%s'>%s</a>" .Release.Repo.HTMLURL .Release.Repo.FullName}}
{{$repo_url := printf "<a href='%s'>%s</a>" .Issue.Repo.HTMLURL .Issue.Repo.FullName}}
{{$link := printf "<a href='%s'>#%d</a>" .Link .Issue.Index}}
<body>
<p>
Expand Down