aboutsummaryrefslogtreecommitdiffstats
path: root/services/mailer/mail_release.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/mailer/mail_release.go')
-rw-r--r--services/mailer/mail_release.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/services/mailer/mail_release.go b/services/mailer/mail_release.go
index ee4c6f3a59..1ca9ad02d7 100644
--- a/services/mailer/mail_release.go
+++ b/services/mailer/mail_release.go
@@ -6,6 +6,7 @@ package mailer
import (
"bytes"
+ "context"
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/models/db"
@@ -25,7 +26,7 @@ const (
)
// MailNewRelease send new release notify to all all repo watchers.
-func MailNewRelease(rel *models.Release) {
+func MailNewRelease(ctx context.Context, rel *models.Release) {
if setting.MailService == nil {
// No mail service configured
return
@@ -51,15 +52,16 @@ func MailNewRelease(rel *models.Release) {
}
for lang, tos := range langMap {
- mailNewRelease(lang, tos, rel)
+ mailNewRelease(ctx, lang, tos, rel)
}
}
-func mailNewRelease(lang string, tos []string, rel *models.Release) {
+func mailNewRelease(ctx context.Context, lang string, tos []string, rel *models.Release) {
locale := translation.NewLocale(lang)
var err error
rel.RenderedNote, err = markdown.RenderString(&markup.RenderContext{
+ Ctx: ctx,
URLPrefix: rel.Repo.Link(),
Metas: rel.Repo.ComposeMetas(),
}, rel.Note)