Module: Sipity::Commands::NotificationCommands

Defined in:
app/repositories/sipity/commands/notification_commands.rb

Overview

Commands

Instance Method Summary collapse

Instance Method Details

#send_notification_for_entity_trigger(notification:, entity:, to_roles:) ⇒ Object



9
10
11
12
13
14
15
# File 'app/repositories/sipity/commands/notification_commands.rb', line 9

def send_notification_for_entity_trigger(notification:, entity:, to_roles:)
  # These instance variables are not needed; But to appeas Rubocop I'm
  # using them.
  to_emails = Queries::PermissionQueries.emails_for_associated_users(entity: entity, roles: to_roles)
  # TODO: Will we want to be logging this as an event?
  Services::Notifier.deliver(notification: notification, to: to_emails, entity: entity)
end