Class: Decidim::BlockUserMailer

Inherits:
ApplicationMailer show all
Defined in:
app/mailers/decidim/block_user_mailer.rb

Overview

A custom mailer for Decidim so we can notify users when their account was blocked

Instance Method Summary collapse

Methods included from OrganizationHelper

#current_organization_name, #organization_colors, #organization_description_label, #organization_name

Methods included from TranslatableAttributes

#default_locale?

Methods included from SanitizeHelper

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

Instance Method Details

#notify(user, justification) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/mailers/decidim/block_user_mailer.rb', line 7

def notify(user, justification)
  with_user(user) do
    @user = user
    @organization = user.organization
    @justification = justification
    subject = I18n.t(
      "decidim.block_user_mailer.notify.subject",
      organization_name: organization_name(@organization),
      justification: @justification
    )

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