Sha256: 4ddd5b64046f7d7415ef475a2d2890495b162d83b882a8f036d5e51e638e9634

Contents?: true

Size: 857 Bytes

Versions: 12

Compression:

Stored size: 857 Bytes

Contents

# frozen_string_literal: true

module Decidim
  #
  # Decorator for events in mail digest
  #
  class NotificationsDigestPresenter < SimpleDelegator
    def subject
      I18n.t("decidim.notifications_digest_mailer.subject")
    end

    def header
      I18n.t("decidim.notifications_digest_mailer.header.#{frequency}")
    end

    def formated_date(date)
      I18n.l(date, format: :long)
    end

    def greeting
      I18n.t("decidim.notifications_digest_mailer.hello", name: name)
    end

    def intro
      I18n.t("decidim.notifications_digest_mailer.intro.#{frequency}")
    end

    def outro
      I18n.t("decidim.notifications_digest_mailer.outro")
    end

    def see_more
      I18n.t("decidim.notifications_digest_mailer.see_more")
    end

    private

    def frequency
      notifications_sending_frequency || "daily"
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
decidim-core-0.27.9 app/presenters/decidim/notifications_digest_presenter.rb
decidim-core-0.27.8 app/presenters/decidim/notifications_digest_presenter.rb
decidim-core-0.27.7 app/presenters/decidim/notifications_digest_presenter.rb
decidim-core-0.27.6 app/presenters/decidim/notifications_digest_presenter.rb
decidim-core-0.27.5 app/presenters/decidim/notifications_digest_presenter.rb
decidim-core-0.27.4 app/presenters/decidim/notifications_digest_presenter.rb
decidim-core-0.27.3 app/presenters/decidim/notifications_digest_presenter.rb
decidim-core-0.27.2 app/presenters/decidim/notifications_digest_presenter.rb
decidim-core-0.27.1 app/presenters/decidim/notifications_digest_presenter.rb
decidim-core-0.27.0 app/presenters/decidim/notifications_digest_presenter.rb
decidim-core-0.27.0.rc2 app/presenters/decidim/notifications_digest_presenter.rb
decidim-core-0.27.0.rc1 app/presenters/decidim/notifications_digest_presenter.rb