jam-cloud/ruby/lib/jam_ruby/app/mailers/admin_mailer.rb

54 lines
1.5 KiB
Ruby
Raw Normal View History

module JamRuby
# sends out a boring ale
2015-10-08 02:12:26 +00:00
class AdminMailer < ActionMailer::Base
include SendGrid
DEFAULT_SENDER = "JamKazam <noreply@jamkazam.com>"
default :from => DEFAULT_SENDER
sendgrid_category :use_subject_lines
#sendgrid_enable :opentrack, :clicktrack # this makes our emails creepy, imo (seth)
sendgrid_unique_args :env => Environment.mode
def alerts(options)
mail(to: APP_CONFIG.email_alerts_alias,
from: APP_CONFIG.email_generic_from,
body: options[:body],
content_type: "text/plain",
subject: options[:subject])
end
2016-01-04 04:13:01 +00:00
def crash_alert(options)
mail(to: APP_CONFIG.email_crashes_alias,
from: APP_CONFIG.email_generic_from,
body: options[:body],
content_type: "text/plain",
subject: options[:subject])
end
2015-10-08 02:12:26 +00:00
def social(options)
mail(to: APP_CONFIG.email_social_alias,
from: APP_CONFIG.email_generic_from,
body: options[:body],
content_type: "text/plain",
subject: options[:subject])
end
def recurly_alerts(user, options)
body = options[:body]
body << "\n\n"
body << "User " << user.admin_url + "\n"
body << "User's JamTracks " << user.jam_track_rights_admin_url + "\n"
mail(to: APP_CONFIG.email_recurly_notice,
from: APP_CONFIG.email_generic_from,
body: body,
content_type: "text/plain",
subject: options[:subject])
end
end
end