Fix system-email page and ActionMailer configuration, now gmail is working fine
This commit is contained in:
parent
ab94c79fdb
commit
822c23e841
|
@ -2,28 +2,30 @@ class CronMail < ActionMailer::Base
|
||||||
default :from => "orbit_test@rulingcom.com"
|
default :from => "orbit_test@rulingcom.com"
|
||||||
|
|
||||||
def get_settings
|
def get_settings
|
||||||
# @@smtp_settings = {
|
@site = Site.first
|
||||||
# :address => "smtp.gmail.com",
|
@@smtp_settings = {
|
||||||
# :port => '587',
|
:enable_starttls_auto => @site['site_settings']['enable_starttls_auto'],
|
||||||
# :domain => "smtp.gmail.com",
|
:address => @site['site_settings']['address'],
|
||||||
# :authentication => "plain",
|
:port => @site['site_settings']['port'],
|
||||||
# :user_name => "redmine@rulingcom.com",
|
:domain => @site['site_settings']['domain'],
|
||||||
# :password => "rulingredmine",
|
:authentication => @site['site_settings']['authentication'],
|
||||||
# :tls => true,
|
:user_name => @site['site_settings']['user_name'],
|
||||||
# :enable_starttls_auto => true
|
:password => @site['site_settings']['password']
|
||||||
# }
|
|
||||||
@@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']
|
|
||||||
}
|
}
|
||||||
end
|
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)
|
def time_check(msg)
|
||||||
get_settings
|
get_settings
|
||||||
|
|
|
@ -65,7 +65,7 @@
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label muted"><%= t 'mail.domain' %></label>
|
<label class="control-label muted"><%= t 'mail.domain' %></label>
|
||||||
<div class="controls">
|
<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>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
|
@ -83,7 +83,7 @@
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label muted"><%= t 'mail.password' %></label>
|
<label class="control-label muted"><%= t 'mail.password' %></label>
|
||||||
<div class="controls">
|
<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>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
|
|
|
@ -63,15 +63,5 @@ Orbit::Application.configure do
|
||||||
config.action_mailer.delivery_method = :smtp
|
config.action_mailer.delivery_method = :smtp
|
||||||
config.action_mailer.perform_deliveries = true
|
config.action_mailer.perform_deliveries = true
|
||||||
config.action_mailer.raise_delivery_errors = 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
|
end
|
||||||
|
|
Reference in New Issue