1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

refactor: split utility functions into utils and helpers

This commit is contained in:
Ferdinand Mütsch
2022-12-01 10:57:07 +01:00
parent c5fda02900
commit 21f6809f05
35 changed files with 259 additions and 236 deletions

View File

@ -3,6 +3,7 @@ package mail
import (
"bytes"
"fmt"
"github.com/muety/wakapi/helpers"
"github.com/muety/wakapi/models"
"github.com/muety/wakapi/routes"
"github.com/muety/wakapi/services"
@ -115,7 +116,7 @@ func (m *MailService) SendReport(recipient *models.User, report *models.Report)
mail := &models.Mail{
From: models.MailAddress(m.config.Mail.Sender),
To: models.MailAddresses([]models.MailAddress{models.MailAddress(recipient.Email)}),
Subject: fmt.Sprintf(subjectReport, utils.FormatDateHuman(time.Now().In(recipient.TZ()))),
Subject: fmt.Sprintf(subjectReport, helpers.FormatDateHuman(time.Now().In(recipient.TZ()))),
}
mail.WithHTML(tpl.String())
return m.sendingService.Send(mail)