17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/tolliver/mailers/notification_mailer.rb', line 17
def notify(notification, notification_receiver)
@sender_email = Tolliver.email_sender
raise Tolliver::Errors::StandardError.new("Please specify e-mail sender.") if @sender_email.nil?
unless Tolliver.email_sender_name.blank?
@sender_email = "#{Tolliver.email_sender_name} <#{@sender_email}>"
end
@notification = notification
@notification_receiver = notification_receiver
notification.notification_attachments.each do |notification_attachment|
attachments[notification_attachment.name] = notification_attachment.read if notification_attachment.read
end
mail(from: @sender_email, to: @notification_receiver.receiver_email.to_s, subject: @notification.subject)
end
|