fix: remove redundante names
This commit was merged in pull request #299.
This commit is contained in:
@@ -8,25 +8,25 @@ import (
|
||||
"net/smtp"
|
||||
)
|
||||
|
||||
type MailService interface {
|
||||
type Mail interface {
|
||||
// Sending an email is a fire and forget operation. Thus no error handling
|
||||
SendMail(to string, subject string, message string)
|
||||
}
|
||||
|
||||
type MailServiceImpl struct {
|
||||
serverSettings *types.ServerSettings
|
||||
type MailImpl struct {
|
||||
server *types.Settings
|
||||
}
|
||||
|
||||
func NewMailServiceImpl(serverSettings *types.ServerSettings) MailServiceImpl {
|
||||
return MailServiceImpl{serverSettings: serverSettings}
|
||||
func NewMailImpl(server *types.Settings) MailImpl {
|
||||
return MailImpl{server: server}
|
||||
}
|
||||
|
||||
func (m MailServiceImpl) SendMail(to string, subject string, message string) {
|
||||
if m.serverSettings.Smtp == nil {
|
||||
func (m MailImpl) SendMail(to string, subject string, message string) {
|
||||
if m.server.Smtp == nil {
|
||||
return
|
||||
}
|
||||
|
||||
s := m.serverSettings.Smtp
|
||||
s := m.server.Smtp
|
||||
|
||||
auth := smtp.PlainAuth("", s.User, s.Pass, s.Host)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user