Sha256: 1124d12bd535effe212b5e16a690e283fa55d478bbf13131acf5d7757e9838f6

Contents?: true

Size: 819 Bytes

Versions: 2

Compression:

Stored size: 819 Bytes

Contents

module E9Crm
  module SystemEmailsController
    extend ActiveSupport::Concern

    included do
      alias :prepare_email_args_without_crm :prepare_email_args

      def prepare_email_args
        args    = prepare_email_args_without_crm.dup
        options = args.extract_options!

        if resource.try(:identifier) == Offer::Identifiers::CONVERSION_EMAIL
          offer = Offer.new(:name => 'TEST OFFER')
          lead  = Deal.new(:offer      => offer,
                           :lead_email => 'LEAD_EMAIL@example.com',
                           :lead_name  => 'LEAD_NAME',
                           :info       => 'Some Info',
                           :created_at => DateTime.now)

          options.merge! :offer => offer, :lead => lead
        end

        (args << options)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
e9_crm-0.1.34 lib/e9_crm/system_emails_controller.rb
e9_crm-0.1.33 lib/e9_crm/system_emails_controller.rb