Fix system-email page and ActionMailer configuration, now gmail is working fine

This commit is contained in:
Manson Wang 2014-02-05 18:06:23 +08:00
parent 22fc153cd8
commit b0f1407374
3 changed files with 23 additions and 31 deletions

View File

@ -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
# }
@site = Site.first
@@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']
: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

View File

@ -65,7 +65,7 @@
<div class="control-group">
<label class="control-label muted"><%= t 'mail.domain' %></label>
<div class="controls">
<%= f.text_field :port, :value => (@site['site_settings']['port'] rescue nil), :class=>"input-large", :placeholder=>"Domain" %>
<%= f.text_field :domain, :value => (@site['site_settings']['domain'] rescue nil), :class=>"input-large", :placeholder=>"Domain" %>
</div>
</div>
<div class="control-group">
@ -83,7 +83,7 @@
<div class="control-group">
<label class="control-label muted"><%= t 'mail.password' %></label>
<div class="controls">
<%= f.text_field :password, :value => (@site['site_settings']['password'] rescue nil), :class=>"input-large", :placeholder=>"Password" %>
<%= f.password_field :password, :value => (@site['site_settings']['password'] rescue nil), :class=>"input-large", :placeholder=>"Password" %>
</div>
</div>
<div class="control-group">

View File

@ -63,15 +63,5 @@ Orbit::Application.configure do
config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true
config.action_mailer.smtp_settings = {
:enable_starttls_auto => true,
:openssl_verify_mode => 'none',
:address => 'smtp.sendgrid.net',
:port => '587',
:domain => "new.tp.rulingcom.com",
:authentication => "plain",
:user_name => "rulingcom",
:password => "bjo4xjp6"
}
end