unified code verification service
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
|
||||
"github.com/tech/sendico/pkg/model"
|
||||
"github.com/tech/sendico/pkg/mutil/mzap"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
@@ -11,7 +12,7 @@ func (a *NotificationAPI) onPasswordReset(context context.Context, account *mode
|
||||
var link string
|
||||
var err error
|
||||
if link, err = a.dp.GetFullLink("password", "reset", account.ID.Hex(), resetToken); err != nil {
|
||||
a.logger.Warn("Failed to generate password reset link", zap.Error(err), zap.String("login", account.Login))
|
||||
a.logger.Warn("Failed to generate password reset link", zap.Error(err), mzap.Login(account))
|
||||
return err
|
||||
}
|
||||
mr := a.client.MailBuilder().
|
||||
@@ -22,9 +23,9 @@ func (a *NotificationAPI) onPasswordReset(context context.Context, account *mode
|
||||
AddData("URL", link).
|
||||
SetTemplateID("reset-password")
|
||||
if err := a.client.Send(mr); err != nil {
|
||||
a.logger.Warn("Failed to send password reset email", zap.Error(err), zap.String("login", account.Login))
|
||||
a.logger.Warn("Failed to send password reset email", zap.Error(err), mzap.Login(account))
|
||||
return err
|
||||
}
|
||||
a.logger.Info("Password reset email sent", zap.String("login", account.Login))
|
||||
a.logger.Info("Password reset email sent", mzap.Login(account))
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user