* decouple emailservice from app package * fix some escaped errors * move email package under app directory * fix i18n * reflect review comments
32 строки
1.4 KiB
Go
32 строки
1.4 KiB
Go
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
package email
|
|
|
|
import (
|
|
"github.com/mattermost/mattermost-server/v5/shared/mail"
|
|
"github.com/mattermost/mattermost-server/v5/utils"
|
|
)
|
|
|
|
func (es *Service) mailServiceConfig() *mail.SMTPConfig {
|
|
emailSettings := es.config().EmailSettings
|
|
hostname := utils.GetHostnameFromSiteURL(*es.config().ServiceSettings.SiteURL)
|
|
cfg := mail.SMTPConfig{
|
|
Hostname: hostname,
|
|
ConnectionSecurity: *emailSettings.ConnectionSecurity,
|
|
SkipServerCertificateVerification: *emailSettings.SkipServerCertificateVerification,
|
|
ServerName: *emailSettings.SMTPServer,
|
|
Server: *emailSettings.SMTPServer,
|
|
Port: *emailSettings.SMTPPort,
|
|
ServerTimeout: *emailSettings.SMTPServerTimeout,
|
|
Username: *emailSettings.SMTPUsername,
|
|
Password: *emailSettings.SMTPPassword,
|
|
EnableSMTPAuth: *emailSettings.EnableSMTPAuth,
|
|
SendEmailNotifications: *emailSettings.SendEmailNotifications,
|
|
FeedbackName: *emailSettings.FeedbackName,
|
|
FeedbackEmail: *emailSettings.FeedbackEmail,
|
|
ReplyToAddress: *emailSettings.ReplyToAddress,
|
|
}
|
|
return &cfg
|
|
}
|