Class: Decidim::NotificationGeneratorForRecipientJob

Inherits:
ApplicationJob
  • Object
show all
Defined in:
decidim-core/app/jobs/decidim/notification_generator_for_recipient_job.rb

Instance Method Summary collapse

Instance Method Details

#perform(event, event_class_name, resource, recipient, user_role, extra) ⇒ Object

rubocop:disable Metrics/ParameterLists



7
8
9
10
11
12
13
14
# File 'decidim-core/app/jobs/decidim/notification_generator_for_recipient_job.rb', line 7

def perform(event, event_class_name, resource, recipient, user_role, extra) # rubocop:disable Metrics/ParameterLists
  event_class = event_class_name.constantize
  notification = NotificationGeneratorForRecipient
                 .new(event, event_class, resource, recipient, user_role, extra)
                 .generate

  SendPushNotification.new.perform(notification) if notification
end