6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'app/mailers/effective/notifications_mailer.rb', line 6
def notification(notification, resource = nil, opts = {})
raise('expected an Effective::Notification') unless notification.kind_of?(Effective::Notification)
@assigns = assigns_for(notification, resource)
to = notification.to_email(resource)
raise('expected a to email address') unless to.present?
attach_report!(notification)
opts.delete(:content_type) if notification.attach_report?
if defined?(Postmark)
opts.merge!(message_stream: 'broadcast-stream')
append_unsubscribe_link!(notification, opts)
end
mail(to: to, **(resource, opts))
end
|