Class: ResourceExportMailer

Inherits:
ApplicationMailer
  • Object
show all
Defined in:
app/mailers/resource_export_mailer.rb

Instance Method Summary collapse

Instance Method Details

#completed(resource_export_file) ⇒ Object



2
3
4
5
6
7
8
# File 'app/mailers/resource_export_mailer.rb', line 2

def completed(resource_export_file)
  @resource_export_file = resource_export_file
  @library_group = LibraryGroup.site_config
  from = "#{LibraryGroup.system_name(resource_export_file.user.profile.locale)} <#{@library_group.user.email}>"
  subject = "#{I18n.t('resource_export_mailer.completed.subject')}: #{@resource_export_file.id}"
  mail(from: from, to: resource_export_file.user.email, subject: subject)
end

#failed(resource_export_file) ⇒ Object



10
11
12
13
14
15
16
# File 'app/mailers/resource_export_mailer.rb', line 10

def failed(resource_export_file)
  @resource_export_file = resource_export_file
  @library_group = LibraryGroup.site_config
  from = "#{LibraryGroup.system_name(resource_export_file.user.profile.locale)} <#{@library_group.user.email}>"
  subject = "#{I18n.t('resource_export_mailer.failed.subject')}: #{@resource_export_file.id}"
  mail(from: from, to: resource_export_file.user.email, subject: subject)
end