mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-10 03:30:22 +00:00
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user