Class: Decidim::NewslettersOptInMailer

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

Overview

A custom mailer for Decidim so we can notify users to verify their own newsletter notifications settings. GDPR related

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, token) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'app/mailers/decidim/newsletters_opt_in_mailer.rb', line 7

def notify(user, token)
  with_user(user) do
    @user = user
    @organization = user.organization
    @token = token

    mail(to: user.email, subject: I18n.t("decidim.newsletters_opt_in_mailer.notify.subject", organization_name: organization_name(@organization)))
  end
end