orbit-basic/app/mailer/cron_mail.rb

33 lines
1.1 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
# @@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
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