diff options
Diffstat (limited to 'services/mailer/mailer.go')
-rw-r--r-- | services/mailer/mailer.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/services/mailer/mailer.go b/services/mailer/mailer.go index d19ae7b2f4..2e4aa8d71b 100644 --- a/services/mailer/mailer.go +++ b/services/mailer/mailer.go @@ -295,9 +295,18 @@ func NewContext() { go processMailQueue() } -// SendAsync send mail asynchronous +// SendAsync send mail asynchronously func SendAsync(msg *Message) { go func() { mailQueue <- msg }() } + +// SendAsyncs send mails asynchronously +func SendAsyncs(msgs []*Message) { + go func() { + for _, msg := range msgs { + mailQueue <- msg + } + }() +} |