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

33 lines
1.1 KiB
Ruby
Raw Normal View History

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