32 lines
492 B
Go
32 lines
492 B
Go
package clients
|
|
|
|
import (
|
|
"github.com/gofiber/fiber/v2"
|
|
"go.uber.org/zap"
|
|
)
|
|
|
|
type Deps struct {
|
|
SmtpApiUrl string
|
|
SmtpHost string
|
|
SmtpPort string
|
|
SmtpSender string
|
|
Username string
|
|
Password string
|
|
ApiKey string
|
|
FiberClient *fiber.Client
|
|
Logger *zap.Logger
|
|
}
|
|
|
|
type MailClient struct {
|
|
deps Deps
|
|
}
|
|
|
|
func NewMailClient(deps Deps) *MailClient {
|
|
if deps.FiberClient == nil {
|
|
deps.FiberClient = fiber.AcquireClient()
|
|
}
|
|
return &MailClient{
|
|
deps: deps,
|
|
}
|
|
}
|