2012-04-13 04:10:47 +00:00
|
|
|
class CronMail < ActionMailer::Base
|
|
|
|
default :from => "orbit_test@rulingcom.com"
|
|
|
|
|
2012-05-09 03:38:29 +00:00
|
|
|
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']
|
2012-05-09 03:38:29 +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
|
2012-05-09 03:38:29 +00:00
|
|
|
|
2012-04-13 04:10:47 +00:00
|
|
|
def time_check(msg)
|
2012-05-09 03:38:29 +00:00
|
|
|
get_settings
|
2012-04-13 04:10:47 +00:00
|
|
|
#attachments["rails.png"] = File.read("#{Rails.root}/public/images/rails.png")
|
2012-05-09 03:38:29 +00:00
|
|
|
mail(:to => "Chris <chris@rulingcom.com>", :subject => msg)
|
2012-04-13 04:10:47 +00:00
|
|
|
end
|
|
|
|
end
|