Class: Decidim::Budgets::VoteReminderMailer

Inherits:
ApplicationMailer show all
Includes:
SanitizeHelper, TranslationsHelper
Defined in:
decidim-budgets/app/mailers/decidim/budgets/vote_reminder_mailer.rb

Instance Method Summary collapse

Methods included from SanitizeHelper

#decidim_html_escape, #decidim_sanitize, #decidim_sanitize_admin, #decidim_sanitize_editor, #decidim_sanitize_editor_admin, #decidim_sanitize_newsletter, #decidim_url_escape, included

Methods included from TranslationsHelper

empty_translatable, ensure_translatable, multi_translation, translated_in_current_locale?

Methods included from TranslatableAttributes

#default_locale?

Instance Method Details

#vote_reminder(reminder) ⇒ Object

Send the user an email reminder to finish voting

reminder - the reminder to send.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'decidim-budgets/app/mailers/decidim/budgets/vote_reminder_mailer.rb', line 16

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