mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
[refactor] mailer service (#15072)
* Unexport SendUserMail * Instead of "[]*models.User" or "[]string" lists infent "[]*MailRecipient" for mailer * adopt * code format * TODOs for "i18n" * clean * no fallback for lang -> just use english * lint * exec testComposeIssueCommentMessage per lang and use only emails * rm MailRecipient * Dont reload from users from db if you alredy have in ram * nits * minimize diff Signed-off-by: 6543 <6543@obermui.de> * localize subjects * linter ... * Tr extend * start tmpl edit ... * Apply suggestions from code review * use translation.Locale * improve mailIssueCommentBatch Signed-off-by: Andrew Thornton <art27@cantab.net> * add i18n to datas Signed-off-by: Andrew Thornton <art27@cantab.net> * a comment Co-authored-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
@@ -337,13 +337,16 @@ func NewContext() {
|
||||
|
||||
// SendAsync send mail asynchronously
|
||||
func SendAsync(msg *Message) {
|
||||
go func() {
|
||||
_ = mailQueue.Push(msg)
|
||||
}()
|
||||
SendAsyncs([]*Message{msg})
|
||||
}
|
||||
|
||||
// SendAsyncs send mails asynchronously
|
||||
func SendAsyncs(msgs []*Message) {
|
||||
if setting.MailService == nil {
|
||||
log.Error("Mailer: SendAsyncs is being invoked but mail service hasn't been initialized")
|
||||
return
|
||||
}
|
||||
|
||||
go func() {
|
||||
for _, msg := range msgs {
|
||||
_ = mailQueue.Push(msg)
|
||||
|
Reference in New Issue
Block a user