notification serviceda email xabar yuborish qo'shildi

This commit is contained in:
A'zamov Samandar
2025-04-24 23:26:46 +05:00
parent e79718a3ea
commit 40200a4649
7 changed files with 71 additions and 7 deletions

View File

@@ -2,15 +2,19 @@ package notifier
import (
"github.com/JscorpTech/notification/internal/domain"
"github.com/k0kubun/pp/v3"
"github.com/JscorpTech/notification/internal/services"
)
type emailNotifier struct{}
type emailNotifier struct {
EmailService domain.EmailServicePort
}
func NewEmailNotifier() domain.NotifierPort {
return &emailNotifier{}
return &emailNotifier{
EmailService: services.NewEmailService(),
}
}
func (n *emailNotifier) SendMessage(to []string, body string) {
pp.Print(to, body)
n.EmailService.SendMail(to, []byte(body))
}