aboutsummaryrefslogtreecommitdiffstats
path: root/modules/mailer/mailer.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/mailer/mailer.go')
-rw-r--r--modules/mailer/mailer.go15
1 files changed, 6 insertions, 9 deletions
diff --git a/modules/mailer/mailer.go b/modules/mailer/mailer.go
index 411d6eafd8..d19ae7b2f4 100644
--- a/modules/mailer/mailer.go
+++ b/modules/mailer/mailer.go
@@ -258,15 +258,12 @@ func (s *dummySender) Send(from string, to []string, msg io.WriterTo) error {
}
func processMailQueue() {
- for {
- select {
- case msg := <-mailQueue:
- log.Trace("New e-mail sending request %s: %s", msg.GetHeader("To"), msg.Info)
- if err := gomail.Send(Sender, msg.Message); err != nil {
- log.Error("Failed to send emails %s: %s - %v", msg.GetHeader("To"), msg.Info, err)
- } else {
- log.Trace("E-mails sent %s: %s", msg.GetHeader("To"), msg.Info)
- }
+ for msg := range mailQueue {
+ log.Trace("New e-mail sending request %s: %s", msg.GetHeader("To"), msg.Info)
+ if err := gomail.Send(Sender, msg.Message); err != nil {
+ log.Error("Failed to send emails %s: %s - %v", msg.GetHeader("To"), msg.Info, err)
+ } else {
+ log.Trace("E-mails sent %s: %s", msg.GetHeader("To"), msg.Info)
}
}
}