move api/server to api/edge/bff
This commit is contained in:
18
api/edge/bff/internal/server/verificationimp/sendcode.go
Normal file
18
api/edge/bff/internal/server/verificationimp/sendcode.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package verificationimp
|
||||
|
||||
import (
|
||||
cnotifications "github.com/tech/sendico/pkg/messaging/notifications/confirmation"
|
||||
"github.com/tech/sendico/pkg/model"
|
||||
"github.com/tech/sendico/pkg/mutil/mzap"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
func (a *VerificationAPI) sendCode(account *model.Account, target model.VerificationPurpose, destination, code string) {
|
||||
a.logger.Info("Confirmation code generated",
|
||||
zap.String("target", string(target)),
|
||||
mzap.MaskEmail("destination", destination),
|
||||
mzap.AccRef(account.ID))
|
||||
if err := a.producer.SendMessage(cnotifications.Code(a.Name(), account.ID, destination, target, code)); err != nil {
|
||||
a.logger.Warn("Failed to send confirmation code notification", zap.Error(err), mzap.AccRef(account.ID))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user