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

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,
      justification: @justification
    )

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