Class: Dependencies::Kenui::EmailNotification

Inherits:
Object
  • Object
show all
Defined in:
app/services/dependencies/kenui.rb

Constant Summary collapse

ERROR_MESSAGE =
I18n.translate('errors.messages.email_notification_plugin_not_available')

Class Method Summary collapse

Class Method Details

.email_notification_plugin_available?(options_for_klient) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
11
12
13
# File 'app/services/dependencies/kenui.rb', line 8

def email_notification_plugin_available?(options_for_klient)
  is_available = ::Kenui::EmailNotificationService.email_notification_plugin_available?(options_for_klient)
  [is_available, is_available ? nil : ERROR_MESSAGE]
rescue StandardError
  [false, ERROR_MESSAGE]
end

.get_configuration_per_account(account_id, options_for_klient) ⇒ Object



32
33
34
35
36
# File 'app/services/dependencies/kenui.rb', line 32

def (, options_for_klient)
  ::Kenui::EmailNotificationService.(, options_for_klient)
rescue StandardError
  []
end

.get_events_to_consider(options_for_klient) ⇒ Object



26
27
28
29
30
# File 'app/services/dependencies/kenui.rb', line 26

def get_events_to_consider(options_for_klient)
  ::Kenui::EmailNotificationService.get_events_to_consider(options_for_klient)
rescue StandardError
  {}
end

.set_configuration_per_account(account_id, event_types, kb_username, reason, comment, options_for_klient) ⇒ Object



15
16
17
18
19
20
21
22
23
24
# File 'app/services/dependencies/kenui.rb', line 15

def (, event_types, kb_username, reason, comment, options_for_klient)
  ::Kenui::EmailNotificationService.(,
                                                                  event_types,
                                                                  kb_username,
                                                                  reason,
                                                                  comment,
                                                                  options_for_klient)
rescue StandardError
  [false, ERROR_MESSAGE]
end