|
|
|
@ -10,7 +10,9 @@ import ( |
|
|
|
|
|
|
|
|
|
"git.slaventius.ru/test3k/authPostman/internal/config" |
|
|
|
|
kafka "git.slaventius.ru/test3k/authPostman/internal/transport/kafka" |
|
|
|
|
"git.slaventius.ru/test3k/authPostman/internal/transport/telegram" |
|
|
|
|
|
|
|
|
|
// telegram "git.slaventius.ru/test3k/authPostman/internal/transport/telegram"
|
|
|
|
|
smtp "git.slaventius.ru/test3k/authPostman/internal/transport/smtp" |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
const ( |
|
|
|
@ -65,26 +67,26 @@ func (s *AuthPostmanServer) ReadMessage(offset int64) error { |
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
text := fmt.Sprintf("Confirmation code %v", amsg.Code) |
|
|
|
|
postman := telegram.NewService(s.config.Telegram.ChatToken) |
|
|
|
|
message := postman.NewMessage(s.config.Telegram.ChatID, text) |
|
|
|
|
ers := postman.SendMessage(message) |
|
|
|
|
if ers != nil { |
|
|
|
|
log.Print(ers) |
|
|
|
|
} else { |
|
|
|
|
log.Printf("send code %s to %s completed", amsg.Code, amsg.Email) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// //
|
|
|
|
|
// message := smtp.NewMessage("Confirmation code", text)
|
|
|
|
|
// message.AppendRecipient(amsg.Email)
|
|
|
|
|
|
|
|
|
|
// //
|
|
|
|
|
// smtpSender := smtp.NewService(s.config.Smtp.Host, s.config.Smtp.Port, s.config.Smtp.Sender, s.config.Smtp.Password)
|
|
|
|
|
// ers := smtpSender.Send(message)
|
|
|
|
|
// postman := telegram.NewService(s.config.Telegram.ChatToken)
|
|
|
|
|
// message := postman.NewMessage(s.config.Telegram.ChatID, text)
|
|
|
|
|
// ers := postman.SendMessage(message)
|
|
|
|
|
// if ers != nil {
|
|
|
|
|
// log.Print(ers)
|
|
|
|
|
// } else {
|
|
|
|
|
// log.Printf("send code %s to %s completed", amsg.Code, amsg.Email)
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
message := smtp.NewMessage("Confirmation code", text) |
|
|
|
|
message.AppendRecipient(amsg.Email) |
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
smtpSender := smtp.NewService(s.config.Smtp.Host, s.config.Smtp.Port, s.config.Smtp.Sender, s.config.Smtp.Password) |
|
|
|
|
ers := smtpSender.Send(message) |
|
|
|
|
if ers != nil { |
|
|
|
|
log.Print(ers) |
|
|
|
|
} else { |
|
|
|
|
log.Printf("send code %s to %s completed", amsg.Code, amsg.Email) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|