fix: missing service tests #181
All checks were successful
Build Docker Image / Build-Docker-Image (push) Successful in 50s
Build and Push Docker Image / Build-And-Push-Docker-Image (push) Successful in 2m17s

This commit was merged in pull request #202.
This commit is contained in:
2024-10-06 10:05:00 +02:00
parent 4dfd29eac1
commit 0fab1e1f2e
6 changed files with 95 additions and 23 deletions

View File

@@ -6,15 +6,19 @@ import (
"net/smtp"
)
type MailService struct {
type MailService interface {
SendMail(to string, subject string, message string) error
}
type MailServiceImpl struct {
serverSettings *types.ServerSettings
}
func NewMailService(serverSettings *types.ServerSettings) MailService {
return MailService{serverSettings: serverSettings}
func NewMailServiceImpl(serverSettings *types.ServerSettings) MailServiceImpl {
return MailServiceImpl{serverSettings: serverSettings}
}
func (m MailService) SendMail(to string, subject string, message string) error {
func (m MailServiceImpl) SendMail(to string, subject string, message string) error {
if m.serverSettings.Smtp == nil {
return nil
}