Class: Voltron::NotificationMailer

Inherits:
ApplicationMailer
  • Object
show all
Defined in:
app/mailers/voltron/notification_mailer.rb

Instance Method Summary collapse

Instance Method Details

#notify(mail_args, var_args = {}, attachment_args = {}) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'app/mailers/voltron/notification_mailer.rb', line 4

def notify(mail_args, var_args = {}, attachment_args = {})
  # Make all passed in variables instance variables so they can be used in the template
  var_args.each { |name, value| instance_variable_set "@#{name}", value }

  # Add all of the attachments
  attachment_args.each { |name, file| attachments[name] = File.read(file) }

  mail mail_args
end