Class: OpmlExportMailer

Inherits:
ActionMailer::Base
  • Object
show all
Defined in:
app/mailers/opml_export_mailer.rb

Instance Method Summary collapse

Instance Method Details

#export_finished_error_email(user) ⇒ Object

Send an email when the Export OPML background process is finished with an error.


25
26
27
28
29
30
31
# File 'app/mailers/opml_export_mailer.rb', line 25

def export_finished_error_email(user)
  @user = user
  @url = read_url locale: user.locale
  I18n.with_locale user.locale do
    mail to: @user.email
  end
end

#export_finished_success_email(user, filename, opml) ⇒ Object

Send an email when the Export OPML background process is finished successfully. The OPML file is attached to the email.

Receives as arguments:

  • the user who has done the export

  • the filename of the opml, for the attachment

  • a string with the OPML document


13
14
15
16
17
18
19
20
# File 'app/mailers/opml_export_mailer.rb', line 13

def export_finished_success_email(user, filename, opml)
  @user = user
  @url = read_url locale: user.locale
  attachments[filename] = opml
  I18n.with_locale user.locale do
    mail to: @user.email
  end
end