2014-01-16 10:15:00 +00:00
|
|
|
class CronMail < ActionMailer::Base
|
|
|
|
default :from => "orbit_test@rulingcom.com"
|
|
|
|
|
|
|
|
def get_settings
|
2014-02-05 10:06:23 +00:00
|
|
|
@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']
|
2014-01-16 10:15:00 +00:00
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2014-02-05 10:06:23 +00:00
|
|
|
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
|
2014-01-16 10:15:00 +00:00
|
|
|
|
|
|
|
def time_check(msg)
|
|
|
|
get_settings
|
|
|
|
#attachments["rails.png"] = File.read("#{Rails.root}/public/images/rails.png")
|
|
|
|
mail(:to => "Chris <chris@rulingcom.com>", :subject => msg)
|
|
|
|
end
|
|
|
|
end
|