23 lines
479 B
Go
23 lines
479 B
Go
|
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,
|
||
|
})
|
||
|
}
|