Class: Decidim::WelcomeNotificationEvent

Inherits:
Events::BaseEvent show all
Includes:
Events::EmailEvent, Events::NotificationEvent, TranslationsHelper
Defined in:
decidim-core/app/events/decidim/welcome_notification_event.rb

Instance Method Summary collapse

Methods included from TranslationsHelper

empty_translatable, ensure_translatable, multi_translation, translated_in_current_locale?

Methods included from TranslatableAttributes

#default_locale?

Methods inherited from Events::BaseEvent

#content_in_same_language?, #initialize, #organization, #perform_translation?, #resource_locator, #resource_text, #resource_url, #safe_resource_text, #safe_resource_translated_text, #translation_missing?, type

Constructor Details

This class inherits a constructor from Decidim::Events::BaseEvent

Instance Method Details

#bodyObject



18
19
20
# File 'decidim-core/app/events/decidim/welcome_notification_event.rb', line 18

def body
  interpolate(organization.welcome_notification_body.symbolize_keys[I18n.locale])
end

#email_greetingObject



26
# File 'decidim-core/app/events/decidim/welcome_notification_event.rb', line 26

def email_greeting; end

#email_introObject



28
29
30
# File 'decidim-core/app/events/decidim/welcome_notification_event.rb', line 28

def email_intro
  body
end

#email_outroObject



32
# File 'decidim-core/app/events/decidim/welcome_notification_event.rb', line 32

def email_outro; end

#email_subjectObject



22
23
24
# File 'decidim-core/app/events/decidim/welcome_notification_event.rb', line 22

def email_subject
  subject
end

#notification_titleObject



34
35
36
# File 'decidim-core/app/events/decidim/welcome_notification_event.rb', line 34

def notification_title
  ("<p><strong>#{subject}</strong></p>" + body).html_safe
end

#resource_pathObject



38
39
40
# File 'decidim-core/app/events/decidim/welcome_notification_event.rb', line 38

def resource_path
  nil
end

#resource_titleObject



42
43
44
# File 'decidim-core/app/events/decidim/welcome_notification_event.rb', line 42

def resource_title
  nil
end

#subjectObject



14
15
16
# File 'decidim-core/app/events/decidim/welcome_notification_event.rb', line 14

def subject
  interpolate(organization.welcome_notification_subject.symbolize_keys[I18n.locale])
end