Class: Decidim::ExportMailer

Inherits:
ApplicationMailer show all
Defined in:
decidim-core/app/mailers/decidim/export_mailer.rb

Overview

This mailer sends a notification email containing the export as an attachment.

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

#download_your_data_export(user, private_export) ⇒ Object

Public: Sends a notification email with a link to retrieve the result of a download_your_data export in a zipped file.

user - The user to be notified. private_export - The PrivateExport instance where the export data has been attached.

Returns nothing.



31
32
33
34
35
36
37
38
39
# File 'decidim-core/app/mailers/decidim/export_mailer.rb', line 31

def download_your_data_export(user, private_export)
  @user = user
  @organization = user.organization
  @private_export = private_export

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

#export(user, private_export) ⇒ Object

Public: Sends a notification email with the result of an export in a zipped file.

user - The user to be notified. private_export - The PrivateExport instance where the export data has been attached.

Returns nothing.



14
15
16
17
18
19
20
21
22
# File 'decidim-core/app/mailers/decidim/export_mailer.rb', line 14

def export(user, private_export)
  @user = user
  @organization = user.organization
  @private_export = private_export

  with_user(user) do
    mail(to: "#{user.name} <#{user.email}>", subject: I18n.t("decidim.export_mailer.subject", name: private_export.export_type))
  end
end