module Tolliver::Mailers::NotificationMailer
Public Instance Methods
notify(notification, notification_receiver)
click to toggle source
# File lib/tolliver/mailers/notification_mailer.rb, line 17 def notify(notification, notification_receiver) # Sender @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 # Other view data @notification = notification @notification_receiver = notification_receiver # Attachments notification.notification_attachments.each do |notification_attachment| attachments[notification_attachment.name] = notification_attachment.read if notification_attachment.read end # Mail mail(from: @sender_email, to: @notification_receiver.receiver_email.to_s, subject: @notification.subject) end