Add mail_settings
This commit is contained in:
parent
b3be210ff7
commit
41c0c26330
|
@ -1,8 +1,33 @@
|
||||||
class CronMail < ActionMailer::Base
|
class CronMail < ActionMailer::Base
|
||||||
default :from => "orbit_test@rulingcom.com"
|
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']
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
def time_check(msg)
|
def time_check(msg)
|
||||||
|
get_settings
|
||||||
#attachments["rails.png"] = File.read("#{Rails.root}/public/images/rails.png")
|
#attachments["rails.png"] = File.read("#{Rails.root}/public/images/rails.png")
|
||||||
mail(:to => "Matt <matt@rulingcom.com>", :subject => msg)
|
mail(:to => "Chris <chris@rulingcom.com>", :subject => msg)
|
||||||
end
|
end
|
||||||
end
|
end
|
|
@ -12,6 +12,8 @@ class Site
|
||||||
field :private_key, :type => Binary
|
field :private_key, :type => Binary
|
||||||
field :public_key, :type => Binary
|
field :public_key, :type => Binary
|
||||||
field :title_always_on, :type => Boolean, :default => false
|
field :title_always_on, :type => Boolean, :default => false
|
||||||
|
|
||||||
|
field :mail_settings, :type => Hash
|
||||||
|
|
||||||
field :school
|
field :school
|
||||||
field :department
|
field :department
|
||||||
|
|
|
@ -2,4 +2,21 @@
|
||||||
<%= render 'side_bar' %>
|
<%= render 'side_bar' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
mail_setting.html.erb
|
<div id="poststuff">
|
||||||
|
<%= form_for @site, :url => admin_site_path(@site), :html => {:class => "clear"} do |f| %>
|
||||||
|
<%= f.fields_for :site_settings, @site['site_settings'] do |f| %>
|
||||||
|
address: <%= f.text_field :address, :value => @site['site_settings']['address'] %>
|
||||||
|
port: <%= f.text_field :port, :value => @site['site_settings']['port'] %>
|
||||||
|
domain: <%= f.text_field :domain, :value => @site['site_settings']['domain'] %>
|
||||||
|
authentication: <%= f.text_field :authentication, :value => @site['site_settings']['authentication'] %>
|
||||||
|
user_name: <%= f.text_field :user_name, :value => @site['site_settings']['user_name'] %>
|
||||||
|
password: <%= f.text_field :password, :value => @site['site_settings']['password'] %>
|
||||||
|
tls: <%= f.check_box :tls, :checked => @site['site_settings']['tls'].eql?('1') %>
|
||||||
|
enable_starttls_auto: <%= f.check_box 'enable_starttls_auto', :checked => @site['site_settings']['enable_starttls_auto'].eql?('1') %>
|
||||||
|
<% end %>
|
||||||
|
<div class="form-actions">
|
||||||
|
<%= f.submit t("submit"), :class => "btn btn-primary" %>
|
||||||
|
<%= f.submit t("cancel"), :class => "btn ", :type => 'reset' %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
|
@ -29,16 +29,16 @@ Orbit::Application.configure do
|
||||||
# :sender_address => %{"notifier" <redmine@rulingcom.com>},
|
# :sender_address => %{"notifier" <redmine@rulingcom.com>},
|
||||||
# :exception_recipients => %w{chris@rulingcom.com}
|
# :exception_recipients => %w{chris@rulingcom.com}
|
||||||
|
|
||||||
config.action_mailer.delivery_method = :smtp
|
# config.action_mailer.delivery_method = :smtp
|
||||||
config.action_mailer.smtp_settings = {
|
# config.action_mailer.smtp_settings = {
|
||||||
:tls => true,
|
# :tls => true,
|
||||||
:enable_starttls_auto => true,
|
# :enable_starttls_auto => true,
|
||||||
:address => "smtp.gmail.com",
|
# :address => "smtp.gmail.com",
|
||||||
:port => '587',
|
# :port => '587',
|
||||||
:domain => "smtp.gmail.com",
|
# :domain => "smtp.gmail.com",
|
||||||
:authentication => "plain",
|
# :authentication => "plain",
|
||||||
:user_name => "redmine@rulingcom.com",
|
# :user_name => "redmine@rulingcom.com",
|
||||||
:password => "rulingredmine" }
|
# :password => "rulingredmine" }
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue