feat: expose mock email service function

This commit is contained in:
2023-10-21 20:56:32 +02:00
parent 9eb969a4c3
commit a946f769ac
2 changed files with 30 additions and 26 deletions

View File

@@ -1,7 +1,6 @@
package email
import (
"crypto/tls"
"fmt"
"net/smtp"
"os"
@@ -44,19 +43,7 @@ func TestNewConfig_MissingEnvFile(t *testing.T) {
}
func TestMockSendEmail(t *testing.T) {
service := &EmailService{
auth: smtp.PlainAuth("", "", "", ""),
host: "",
port: "",
from: "",
tlsconfig: &tls.Config{
InsecureSkipVerify: true,
ServerName: "",
},
dial: func(hostPort string) (SMTPClientIface, error) {
return &MockSMTP{}, nil
},
}
service := NewMockMailService()
emailData := EmailMessage{
To: "test@example.com",