6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'app/mailers/notify_on/notification_mailer.rb', line 6
def notify(notification_id, template = 'notify', files = [])
@notification = NotifyOn::Notification.find_by_id(notification_id)
@recipient = @notification.recipient
@sender = @notification.sender
@trigger = @notification.trigger
files.each { |attr| attachments[attr[:name]] = attr[:file] }
if @notification.should_save_email_id?
['message-id'] = (message_id = SecureRandom.uuid)
@trigger.update_columns(:message_id => message_id)
end
mail :to => @recipient.email,
:from => @notification.email_from,
:reply_to => @notification.email_reply_to || @notification.email_from,
:subject => @notification.email_subject,
:template_path => 'notifications',
:template_name => template
end
|