mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
refactor: mail service abstraction layer
This commit is contained in:
@ -3,24 +3,11 @@ package mail
|
||||
import (
|
||||
"github.com/emvi/logbuch"
|
||||
"github.com/muety/wakapi/models"
|
||||
"time"
|
||||
)
|
||||
|
||||
type NoopMailService struct{}
|
||||
type NoopSendingService struct{}
|
||||
|
||||
const notImplemented = "noop mail service doing nothing instead of sending password reset mail to %s"
|
||||
|
||||
func (n *NoopMailService) SendReport(recipient *models.User, report *models.Report) error {
|
||||
logbuch.Info(notImplemented, recipient.ID)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (n *NoopMailService) SendPasswordReset(recipient *models.User, resetLink string) error {
|
||||
logbuch.Info(notImplemented, recipient.ID)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (n *NoopMailService) SendImportNotification(recipient *models.User, duration time.Duration, numHeartbeats int) error {
|
||||
logbuch.Info(notImplemented, recipient.ID)
|
||||
func (n *NoopSendingService) Send(mail *models.Mail) error {
|
||||
logbuch.Info("noop mail service doing nothing instead of sending password reset mail to [%v]", mail.To.Strings())
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user