Sha256: f4ce2abfe3b0f2403a65cfd8af1bc6f31c0b447396506aa7f59b8d97a5cc2ee3

Contents?: true

Size: 921 Bytes

Versions: 32

Compression:

Stored size: 921 Bytes

Contents

require 'rails/generators'
require 'spree/core'

module Spree
  module Emails
    module Generators
      class InstallGenerator < Rails::Generators::Base
        desc 'Installs mailers previews for Spree transactional emails'

        def self.source_paths
          [
            File.expand_path('templates', __dir__)
          ]
        end

        def copy_mailers_previews
          preview_path = Rails.application&.config&.action_mailer&.preview_path.presence || 'test/mailers/previews'

          template 'mailers/previews/order_preview.rb', "#{preview_path}/order_preview.rb"
          template 'mailers/previews/shipment_preview.rb', "#{preview_path}/shipment_preview.rb"
          template 'mailers/previews/reimbursement_preview.rb', "#{preview_path}/reimbursement_preview.rb"
          template 'mailers/previews/user_preview.rb', "#{preview_path}/user_preview.rb"
        end
      end
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
spree_emails-4.10.1 lib/generators/spree/emails/install/install_generator.rb
spree_emails-4.10.0 lib/generators/spree/emails/install/install_generator.rb
spree_emails-4.9.0 lib/generators/spree/emails/install/install_generator.rb
spree_emails-4.8.3 lib/generators/spree/emails/install/install_generator.rb
spree_emails-4.8.2 lib/generators/spree/emails/install/install_generator.rb
spree_emails-4.7.3 lib/generators/spree/emails/install/install_generator.rb
spree_emails-4.6.6 lib/generators/spree/emails/install/install_generator.rb
spree_emails-4.5.5 lib/generators/spree/emails/install/install_generator.rb
spree_emails-4.3.3 lib/generators/spree/emails/install/install_generator.rb
spree_emails-4.4.1 lib/generators/spree/emails/install/install_generator.rb
spree_emails-4.5.4 lib/generators/spree/emails/install/install_generator.rb
spree_emails-4.6.5 lib/generators/spree/emails/install/install_generator.rb
spree_emails-4.7.1 lib/generators/spree/emails/install/install_generator.rb
spree_emails-4.6.4 lib/generators/spree/emails/install/install_generator.rb
spree_emails-4.7.0 lib/generators/spree/emails/install/install_generator.rb
spree_emails-4.6.3 lib/generators/spree/emails/install/install_generator.rb
spree_emails-4.6.2 lib/generators/spree/emails/install/install_generator.rb
spree_emails-4.6.1 lib/generators/spree/emails/install/install_generator.rb
spree_emails-4.6.0 lib/generators/spree/emails/install/install_generator.rb
spree_emails-4.5.3 lib/generators/spree/emails/install/install_generator.rb