fix: missing service tests #181
This commit was merged in pull request #202.
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user