Sha256: 0e4628520a2f675450a7fb4e8014e44817cc552487ad424545afaf4f94be8a26

Contents?: true

Size: 1.45 KB

Versions: 72

Compression:

Stored size: 1.45 KB

Contents

# frozen-string_literal: true

module Decidim
  module Initiatives
    class CreateInitiativeEvent < Decidim::Events::BaseEvent
      include Decidim::Events::EmailEvent
      include Decidim::Events::NotificationEvent

      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

72 entries across 72 versions & 1 rubygems

Version Path
decidim-initiatives-0.25.2 app/events/decidim/initiatives/create_initiative_event.rb
decidim-initiatives-0.25.1 app/events/decidim/initiatives/create_initiative_event.rb
decidim-initiatives-0.25.0 app/events/decidim/initiatives/create_initiative_event.rb
decidim-initiatives-0.25.0.rc4 app/events/decidim/initiatives/create_initiative_event.rb
decidim-initiatives-0.25.0.rc3 app/events/decidim/initiatives/create_initiative_event.rb
decidim-initiatives-0.25.0.rc2 app/events/decidim/initiatives/create_initiative_event.rb
decidim-initiatives-0.25.0.rc1 app/events/decidim/initiatives/create_initiative_event.rb
decidim-initiatives-0.24.3 app/events/decidim/initiatives/create_initiative_event.rb
decidim-initiatives-0.23.6 app/events/decidim/initiatives/create_initiative_event.rb
decidim-initiatives-0.24.2 app/events/decidim/initiatives/create_initiative_event.rb
decidim-initiatives-0.23.5 app/events/decidim/initiatives/create_initiative_event.rb
decidim-initiatives-0.24.1 app/events/decidim/initiatives/create_initiative_event.rb
decidim-initiatives-0.24.0 app/events/decidim/initiatives/create_initiative_event.rb
decidim-initiatives-0.24.0.rc2 app/events/decidim/initiatives/create_initiative_event.rb
decidim-initiatives-0.23.4 app/events/decidim/initiatives/create_initiative_event.rb
decidim-initiatives-0.24.0.rc1 app/events/decidim/initiatives/create_initiative_event.rb
decidim-initiatives-0.23.3 app/events/decidim/initiatives/create_initiative_event.rb
decidim-initiatives-0.23.2 app/events/decidim/initiatives/create_initiative_event.rb
decidim-initiatives-0.23.1 app/events/decidim/initiatives/create_initiative_event.rb
decidim-initiatives-0.23.1.rc1 app/events/decidim/initiatives/create_initiative_event.rb