Class: Decidim::Accountability::ImportMailer

Inherits:
Decidim::ApplicationMailer show all
Defined in:
decidim-accountability/app/mailers/decidim/accountability/import_mailer.rb

Overview

This mailer sends a notification email containing the result of importing a CSV of results.

Instance Method Summary collapse

Methods included from OrganizationHelper

#current_organization_name, #organization_colors, #organization_description_label, #organization_name

Methods included from TranslatableAttributes

#attachment?, #default_locale?

Methods included from SanitizeHelper

#decidim_escape_translated, #decidim_html_escape, #decidim_rich_text, #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

#import(user, errors) ⇒ Object

Public: Sends a notification email with the result of a CSV import of results.

user - The user to be notified. errors - The list of errors generated by the import

Returns nothing.



15
16
17
18
19
20
21
22
23
# File 'decidim-accountability/app/mailers/decidim/accountability/import_mailer.rb', line 15

def import(user, errors)
  @user = user
  @organization = user.organization
  @errors = errors

  with_user(user) do
    mail(to: "#{user.name} <#{user.email}>", subject: I18n.t("decidim.accountability.import_mailer.import.subject"))
  end
end