Class: HolyCow::Mailer

Inherits:
ActionMailer::Base
  • Object
show all
Defined in:
lib/holy_cow/mailer.rb

Instance Method Summary collapse

Instance Method Details

#notification(*args) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/holy_cow/mailer.rb', line 4

def notification(*args)
  @subject = args.shift || "Somebody did something!"
  template = File.join(File.dirname(__FILE__), "..", "..", "template", "notification.html.erb")
  body = ERB.new(File.read(template))
  @things = args || []
  mail(from: HolyCow::from_address, to: HolyCow::recipients, subject: "[Holy Cow] #{@subject}", body: body.result(binding))
end