Sha256: 13836cd5acaca2fe24e42eb3ab0bd82a608e8c8cd2b921ce809f3a0a051eaa69

Contents?: true

Size: 837 Bytes

Versions: 14

Compression:

Stored size: 837 Bytes

Contents

namespace :effective_email_templates do
  desc 'Import email templates from the filesystem to the database. This rake task does not overwrite existing database templates.'
  task import_templates: :environment do
    EffectiveEmailTemplates::TemplateImporter.invoke
  end

  desc 'Overwrite existing default database email templates from the filesystem.'
  task overwrite_templates: :environment do
    puts 'By running this task, all email templates that exist in the database will be overwritten by the templates in the filesystem. Do you still want to run this task? (Y/n): '
    answer = $stdin.gets.chomp

    if answer.downcase == 'y'
      EffectiveEmailTemplates::TemplateImporter.invoke(overwrite: true)
      puts 'Default email templates have been overwritten successfully!'
    else
      puts 'Cancelled!'
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
effective_email_templates-0.6.1 lib/tasks/effective_email_templates/import_default_views.rake
effective_email_templates-0.6.0 lib/tasks/effective_email_templates/import_default_views.rake
effective_email_templates-0.5.1 lib/tasks/effective_email_templates/import_default_views.rake
effective_email_templates-0.5.0 lib/tasks/effective_email_templates/import_default_views.rake
effective_email_templates-0.4.6 lib/tasks/effective_email_templates/import_default_views.rake
effective_email_templates-0.4.5 lib/tasks/effective_email_templates/import_default_views.rake
effective_email_templates-0.4.4 lib/tasks/effective_email_templates/import_default_views.rake
effective_email_templates-0.4.3 lib/tasks/effective_email_templates/import_default_views.rake
effective_email_templates-0.4.2 lib/tasks/effective_email_templates/import_default_views.rake
effective_email_templates-0.4.1 lib/tasks/effective_email_templates/import_default_views.rake
effective_email_templates-0.4.0 lib/tasks/effective_email_templates/import_default_views.rake
effective_email_templates-0.3.5 lib/tasks/effective_email_templates/import_default_views.rake
effective_email_templates-0.3.4 lib/tasks/effective_email_templates/import_default_views.rake
effective_email_templates-0.3.3 lib/tasks/effective_email_templates/import_default_views.rake