2024-02-05 11:13:36 +00:00
|
|
|
package integration
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/gofiber/fiber/v2"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
"go.uber.org/zap"
|
2024-11-18 07:23:41 +00:00
|
|
|
"gitea.pena/PenaSide/customer/internal/interface/client"
|
|
|
|
"gitea.pena/PenaSide/customer/internal/models"
|
2024-02-05 11:13:36 +00:00
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestSendMessage(t *testing.T) {
|
|
|
|
sender := "noreply@mailing.pena.digital"
|
|
|
|
apiKey := "P0YsjUB137upXrr1NiJefHmXVKW1hmBWlpev"
|
|
|
|
|
|
|
|
mailClient := client.NewMailClient(client.MailClientDeps{
|
|
|
|
ApiUrl: "https://api.smtp.bz/v1/smtp/send",
|
|
|
|
Sender: sender,
|
|
|
|
ApiKey: apiKey,
|
|
|
|
Auth: &models.PlainAuth{Username: "kotilion.95@gmail.com", Password: "vWwbCSg4bf0p"},
|
|
|
|
FiberClient: fiber.AcquireClient(),
|
|
|
|
Logger: zap.NewExample(),
|
2024-05-21 13:50:26 +00:00
|
|
|
MailAddress: "pashamullin2001@gmail.com",
|
2024-02-05 11:13:36 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
userEmail := "test@example.com"
|
|
|
|
verification := &models.Verification{
|
|
|
|
UserID: "test",
|
|
|
|
Files: []models.VerificationFile{
|
|
|
|
{Name: "file1", URL: "http://test/file1"},
|
|
|
|
{Name: "file2", URL: "http://test/file2"},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2024-02-15 09:03:24 +00:00
|
|
|
err := mailClient.SendMessage(userEmail, verification, 10)
|
2024-02-05 11:13:36 +00:00
|
|
|
assert.NoError(t, err, "successful")
|
|
|
|
}
|