Sha256: 5ee9d2d60b2a674f4c87d311a6d0ba9cd5c5ddd528c826dfac54e59d6ba4fe7d

Contents?: true

Size: 961 Bytes

Versions: 13

Compression:

Stored size: 961 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Budgets
    class VoteReminderMailer < Decidim::ApplicationMailer
      include Decidim::TranslationsHelper
      include Decidim::SanitizeHelper

      helper Decidim::TranslationsHelper

      helper_method :routes

      # Send the user an email reminder to finish voting
      #
      # reminder - the reminder to send.
      def vote_reminder(reminder)
        @reminder = reminder
        @user = reminder.user
        with_user(@user) do
          @orders = reminder.records.active.map(&:remindable)
          @organization = @user.organization

          subject = I18n.t(
            "decidim.budgets.vote_reminder_mailer.vote_reminder.email_subject",
            count: @orders.count
          )

          mail(to: @user.email, subject:)
        end
      end

      private

      def routes
        @routes ||= Decidim::EngineRouter.main_proxy(@reminder.component)
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
decidim-budgets-0.29.1 app/mailers/decidim/budgets/vote_reminder_mailer.rb
decidim-budgets-0.28.4 app/mailers/decidim/budgets/vote_reminder_mailer.rb
decidim-budgets-0.29.0 app/mailers/decidim/budgets/vote_reminder_mailer.rb
decidim-budgets-0.28.3 app/mailers/decidim/budgets/vote_reminder_mailer.rb
decidim-budgets-0.29.0.rc4 app/mailers/decidim/budgets/vote_reminder_mailer.rb
decidim-budgets-0.29.0.rc3 app/mailers/decidim/budgets/vote_reminder_mailer.rb
decidim-budgets-0.29.0.rc2 app/mailers/decidim/budgets/vote_reminder_mailer.rb
decidim-budgets-0.29.0.rc1 app/mailers/decidim/budgets/vote_reminder_mailer.rb
decidim-budgets-0.28.2 app/mailers/decidim/budgets/vote_reminder_mailer.rb
decidim-budgets-0.28.1 app/mailers/decidim/budgets/vote_reminder_mailer.rb
decidim-budgets-0.28.0 app/mailers/decidim/budgets/vote_reminder_mailer.rb
decidim-budgets-0.28.0.rc5 app/mailers/decidim/budgets/vote_reminder_mailer.rb
decidim-budgets-0.28.0.rc4 app/mailers/decidim/budgets/vote_reminder_mailer.rb