aboutsummaryrefslogtreecommitdiffstats
path: root/services/mailer/mailer.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/mailer/mailer.go')
-rw-r--r--services/mailer/mailer.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/services/mailer/mailer.go b/services/mailer/mailer.go
index fdbb6e562b..1f43c7f827 100644
--- a/services/mailer/mailer.go
+++ b/services/mailer/mailer.go
@@ -7,6 +7,7 @@ package mailer
import (
"bytes"
+ "context"
"crypto/tls"
"fmt"
"hash/fnv"
@@ -348,7 +349,7 @@ var mailQueue queue.Queue
var Sender gomail.Sender
// NewContext start mail queue service
-func NewContext() {
+func NewContext(ctx context.Context) {
// Need to check if mailQueue is nil because in during reinstall (user had installed
// before but switched install lock off), this function will be called again
// while mail queue is already processing tasks, and produces a race condition.
@@ -381,7 +382,7 @@ func NewContext() {
go graceful.GetManager().RunWithShutdownFns(mailQueue.Run)
- subjectTemplates, bodyTemplates = templates.Mailer()
+ subjectTemplates, bodyTemplates = templates.Mailer(ctx)
}
// SendAsync send mail asynchronously