mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
feat: password resets (resolve #133)
This commit is contained in:
23
services/mail/mail.go
Normal file
23
services/mail/mail.go
Normal file
@ -0,0 +1,23 @@
|
||||
package mail
|
||||
|
||||
import (
|
||||
"github.com/emvi/logbuch"
|
||||
conf "github.com/muety/wakapi/config"
|
||||
"github.com/muety/wakapi/models"
|
||||
"github.com/muety/wakapi/services"
|
||||
)
|
||||
|
||||
func NewMailService() services.IMailService {
|
||||
config := conf.Get()
|
||||
if config.Mail.Provider == conf.MailProviderMailWhale {
|
||||
return NewMailWhaleService(config.Mail.MailWhale)
|
||||
}
|
||||
return &NoopMailService{}
|
||||
}
|
||||
|
||||
type NoopMailService struct{}
|
||||
|
||||
func (n NoopMailService) SendPasswordResetMail(recipient *models.User, resetLink string) error {
|
||||
logbuch.Info("noop mail service doing nothing instead of sending password reset mail to %s", recipient.ID)
|
||||
return nil
|
||||
}
|
Reference in New Issue
Block a user