Class: Decidim::Comments::CommentCreatedEvent

Inherits:
Events::BaseEvent show all
Includes:
Events::EmailEvent, Events::NotificationEvent
Defined in:
decidim-comments/app/events/decidim/comments/comment_created_event.rb

Instance Method Summary collapse

Methods inherited from Events::BaseEvent

#initialize, #resource_locator, #resource_path, #resource_url, types

Constructor Details

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

Instance Method Details

#email_introObject



18
19
20
21
22
23
# File 'decidim-comments/app/events/decidim/comments/comment_created_event.rb', line 18

def email_intro
  I18n.t(
    "decidim.comments.events.comment_created.#{comment_type}.email_intro",
    resource_title: resource_title
  ).html_safe
end

#email_outroObject



25
26
27
28
29
30
# File 'decidim-comments/app/events/decidim/comments/comment_created_event.rb', line 25

def email_outro
  I18n.t(
    "decidim.comments.events.comment_created.#{comment_type}.email_outro",
    resource_title: resource_title
  )
end

#email_subjectObject



9
10
11
12
13
14
15
16
# File 'decidim-comments/app/events/decidim/comments/comment_created_event.rb', line 9

def email_subject
  I18n.t(
    "decidim.comments.events.comment_created.#{comment_type}.email_subject",
    resource_title: resource_title,
    resource_url: resource_locator.url(url_params),
    author_name: comment.author.name
  )
end

#notification_titleObject



32
33
34
35
36
37
38
39
# File 'decidim-comments/app/events/decidim/comments/comment_created_event.rb', line 32

def notification_title
  I18n.t(
    "decidim.comments.events.comment_created.#{comment_type}.notification_title",
    resource_title: resource_title,
    resource_path: resource_locator.path(url_params),
    author_name: comment.author.name
  ).html_safe
end