Remove indirection from MailSettings

We can simply merge the option hashes now because they are not
conditional anymore. Well, the magic `presence` method does the
conditional logic for us now.
This commit is contained in:
Maikel Linke
2024-04-16 15:46:06 +10:00
parent 7e2fcede61
commit 1fc4270613

View File

@@ -20,21 +20,14 @@ module Spree
private
def mail_server_settings
basic_settings.merge(user_credentials)
end
def user_credentials
{ user_name: Config.smtp_username.presence,
password: Config.smtp_password.presence }
end
def basic_settings
{
address: Config.mail_host,
domain: Config.mail_domain,
port: Config.mail_port,
authentication:,
enable_starttls_auto: secure_connection?,
user_name: Config.smtp_username.presence,
password: Config.smtp_password.presence,
}
end