|
|
|
@ -14,8 +14,6 @@ import ( |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
const ( |
|
|
|
|
chatID int64 = 150697696 |
|
|
|
|
token string = "5944264850:AAHaikh8r8NYciybnOpqEvFQpSYgr6JHDZc" |
|
|
|
|
topicRegistrations string = "registrations" // Топик для регистраций
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
@ -66,8 +64,9 @@ func (s *AuthPostmanServer) ReadMessage(offset int64) error { |
|
|
|
|
log.Printf("send code %s to %s ...", amsg.Code, amsg.Email) |
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
postman := telegram.NewService(token) |
|
|
|
|
message := postman.NewMessage(chatID, fmt.Sprintf("Confirmation code %v", amsg.Code)) |
|
|
|
|
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) |
|
|
|
@ -76,7 +75,7 @@ func (s *AuthPostmanServer) ReadMessage(offset int64) error { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// //
|
|
|
|
|
// message := smtp.NewMessage("Confirmation code", amsg.Code)
|
|
|
|
|
// message := smtp.NewMessage("Confirmation code", text)
|
|
|
|
|
// message.AppendRecipient(amsg.Email)
|
|
|
|
|
|
|
|
|
|
// //
|
|
|
|
@ -84,6 +83,8 @@ func (s *AuthPostmanServer) ReadMessage(offset int64) error { |
|
|
|
|
// ers := smtpSender.Send(message)
|
|
|
|
|
// if ers != nil {
|
|
|
|
|
// log.Print(ers)
|
|
|
|
|
// } else {
|
|
|
|
|
// log.Printf("send code %s to %s completed", amsg.Code, amsg.Email)
|
|
|
|
|
// }
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|