This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
orbit-4-1/app/mailer/cron_mail.rb

35 lines
1.2 KiB
Ruby
Raw Permalink Normal View History

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
@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
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