gogstea/internal/mail/mail.go

23 lines
479 B
Go
Executable File

package mail
import (
"gitea.urkob.com/urko/emailsender/pkg/email"
)
type EmailService struct {
emailService *email.EmailService
from string
}
func NewMailService(from string, emailService *email.EmailService) EmailService {
return EmailService{from: from, emailService: emailService}
}
func (srv EmailService) Send(to, subject, body string) error {
return srv.emailService.SendEmail(email.EmailMessage{
To: to,
Subject: subject,
Body: body,
})
}