Move mailer to use a queue (#9789)

* Move mailer to use a queue

* Make sectionMap map[string]bool

* Ensure that Message is json encodable
This commit is contained in:
zeripath 2020-01-16 17:55:36 +00:00 committed by Antoine GIRARD
parent 06cd3e03a2
commit c76c70a16c
4 changed files with 102 additions and 63 deletions

View file

@ -51,7 +51,7 @@ func InitMailRender(subjectTpl *texttmpl.Template, bodyTpl *template.Template) {
// SendTestMail sends a test mail
func SendTestMail(email string) error {
return gomail.Send(Sender, NewMessage([]string{email}, "Gitea Test Email!", "Gitea Test Email!").Message)
return gomail.Send(Sender, NewMessage([]string{email}, "Gitea Test Email!", "Gitea Test Email!").ToMessage())
}
// SendUserMail sends a mail to the user