You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cartodb/app/mailers/import_mailer.rb

38 lines
1.1 KiB

class ImportMailer < ActionMailer::Base
default from: "cartodb.com <support@cartodb.com>"
layout 'mail'
def data_import_finished(user, imported_tables, total_tables, first_imported_table, first_table, errors)
@imported_tables = imported_tables
@total_tables = total_tables
9 years ago
@subject = set_subject
@first_table = first_imported_table.nil? ? first_table : first_imported_table
@link = first_imported_table.nil? ? "#{user.public_url}#{CartoDB.path(self, 'tables_index')}" : "#{user.public_url}#{CartoDB.path(self, 'public_tables_show', { id: @first_table['name'] })}"
@errors = errors
9 years ago
mail :to => user.email,
:subject => @subject
end
private
def set_subject
if @total_tables == 1
if @errors.nil?
10 years ago
subject = "Your CartoDB dataset import just finished"
else
10 years ago
subject = "There was some error while importing your dataset"
end
else
if @imported_tables == 0
10 years ago
subject = "There was some error while importing your datasets"
else
10 years ago
subject = "Your CartoDB datasets import just finished"
end
end
subject
end
end