diff --git a/app/mailer/cron_mail.rb b/app/mailer/cron_mail.rb index bda1d063..c769b23d 100644 --- a/app/mailer/cron_mail.rb +++ b/app/mailer/cron_mail.rb @@ -2,28 +2,30 @@ class CronMail < ActionMailer::Base default :from => "orbit_test@rulingcom.com" def get_settings - # @@smtp_settings = { - # :address => "smtp.gmail.com", - # :port => '587', - # :domain => "smtp.gmail.com", - # :authentication => "plain", - # :user_name => "redmine@rulingcom.com", - # :password => "rulingredmine", - # :tls => true, - # :enable_starttls_auto => true - # } - @@smtp_settings = { - :address => @site['mail_settings']['address'], - :port => @site['mail_settings']['port'], - :domain => @site['mail_settings']['domain'], - :authentication => @site['mail_settings']['authentication'], - :user_name => @site['mail_settings']['user_name'], - :password => @site['mail_settings']['password'], - :tls => @site['mail_settings']['tls'], - :enable_starttls_auto => @site['mail_settings']['enable_starttls_auto'] + @site = Site.first + @@smtp_settings = { + :enable_starttls_auto => @site['site_settings']['enable_starttls_auto'], + :address => @site['site_settings']['address'], + :port => @site['site_settings']['port'], + :domain => @site['site_settings']['domain'], + :authentication => @site['site_settings']['authentication'], + :user_name => @site['site_settings']['user_name'], + :password => @site['site_settings']['password'] } end + def self.smtp_settings + @site = Site.first + @@smtp_settings = { + :enable_starttls_auto => @site['site_settings']['enable_starttls_auto'], + :address => @site['site_settings']['address'], + :port => @site['site_settings']['port'], + :domain => @site['site_settings']['domain'], + :authentication => @site['site_settings']['authentication'], + :user_name => @site['site_settings']['user_name'], + :password => @site['site_settings']['password'] + } + end def time_check(msg) get_settings diff --git a/app/views/admin/sites/preference.html.erb b/app/views/admin/sites/preference.html.erb index 991a03b5..8407bcde 100644 --- a/app/views/admin/sites/preference.html.erb +++ b/app/views/admin/sites/preference.html.erb @@ -65,7 +65,7 @@