orbit-4-2/app/mailer/cron_mail.rb

35 lines
1.2 KiB
Ruby
Raw Normal View History

class CronMail < ActionMailer::Base
default :from => "orbit_test@rulingcom.com"
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']
}
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)
get_settings
#attachments["rails.png"] = File.read("#{Rails.root}/public/images/rails.png")
mail(:to => "Chris <chris@rulingcom.com>", :subject => msg)
end
end