Method: Noticed::DeliveryMethods::Base#perform

Defined in:
lib/noticed/delivery_methods/base.rb

#perform(notification_class:, options:, params:, recipient:, record:) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/noticed/delivery_methods/base.rb', line 9

def perform(notification_class:, options:, params:, recipient:, record:)
  @notification = notification_class.constantize.new(params)
  @options = options
  @recipient = recipient
  @record = record

  # Make notification aware of database record and recipient during delivery
  @notification.record = record
  @notification.recipient = recipient

  run_callbacks :deliver do
    deliver
  end
end