Sha256: e25876c28926e0affff6c4b3b7ec90144881749f78bbc46ac83a95da81c37fa1

Contents?: true

Size: 1.36 KB

Versions: 4

Compression:

Stored size: 1.36 KB

Contents

# frozen-string_literal: true

module Decidim
  module Initiatives
    class CreateInitiativeEvent < Decidim::Events::SimpleEvent
      def email_subject
        I18n.t(
          "decidim.initiatives.events.create_initiative_event.email_subject",
          resource_title: resource_title,
          author_nickname: author.nickname,
          author_name: author.name
        )
      end

      def email_intro
        I18n.t(
          "decidim.initiatives.events.create_initiative_event.email_intro",
          resource_title: resource_title,
          author_nickname: author.nickname,
          author_name: author.name
        )
      end

      def email_outro
        I18n.t(
          "decidim.initiatives.events.create_initiative_event.email_outro",
          resource_title: resource_title,
          author_nickname: author.nickname,
          author_name: author.name
        )
      end

      def notification_title
        I18n.t(
          "decidim.initiatives.events.create_initiative_event.notification_title",
          resource_title: resource_title,
          resource_path: resource_path,
          author_nickname: author.nickname,
          author_name: author.name,
          author_path: author.profile_path
        ).html_safe
      end

      private

      def author
        @author ||= Decidim::UserPresenter.new(resource.author)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
decidim-initiatives-0.27.9 app/events/decidim/initiatives/create_initiative_event.rb
decidim-initiatives-0.27.8 app/events/decidim/initiatives/create_initiative_event.rb
decidim-initiatives-0.27.7 app/events/decidim/initiatives/create_initiative_event.rb
decidim-initiatives-0.27.6 app/events/decidim/initiatives/create_initiative_event.rb