Sha256: 37449eae6db5262eff8ae16884c83d81bd1b9c0ce2fb09345dc77a9981a89540

Contents?: true

Size: 1.03 KB

Versions: 28

Compression:

Stored size: 1.03 KB

Contents

# In Rails 4.1 and above, visit:
# http://localhost:3000/rails/mailers
# to see a preview of the following emails:

class EffectiveQbSyncMailerPreview < ActionMailer::Preview
  # All order_errors are called from QbTicket.error!
  # There are 3 general types of errors that occur

  def error_record_does_not_exist
    order_error('Invalid argument. The specified record does not exist in the list.')
  end

  def error_invalid_reference_to_item
    order_error('There is an invalid reference to QuickBooks Item "Tax On Sale" in the SalesReceipt line.')
  end

  def error_element_already_in_use
    order_error('The name "Peter Pan" of the list element is already in use.')
  end

  def error_unknown
    order_error('unknown')
  end

  private

  def order_error(error)
    order = Effective::Order.new()

    Effective::OrdersMailer.order_error(
      order: order,
      error: error,
      to: EffectiveQbSync.error_email,
      subject: "Quickbooks failed to synchronize order ##{order.to_param}",
      template: 'qb_sync_error'
    )
  end

end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
effective_qb_sync-1.5.0 lib/generators/templates/effective_qb_sync_mailer_preview.rb
effective_qb_sync-1.4.0 lib/generators/templates/effective_qb_sync_mailer_preview.rb
effective_qb_sync-1.3.8 lib/generators/templates/effective_qb_sync_mailer_preview.rb
effective_qb_sync-1.3.7 lib/generators/templates/effective_qb_sync_mailer_preview.rb
effective_qb_sync-1.3.6 lib/generators/templates/effective_qb_sync_mailer_preview.rb
effective_qb_sync-1.3.5 lib/generators/templates/effective_qb_sync_mailer_preview.rb
effective_qb_sync-1.3.4 lib/generators/templates/effective_qb_sync_mailer_preview.rb
effective_qb_sync-1.3.3 lib/generators/templates/effective_qb_sync_mailer_preview.rb
effective_qb_sync-1.3.2 lib/generators/templates/effective_qb_sync_mailer_preview.rb
effective_qb_sync-1.3.1 lib/generators/templates/effective_qb_sync_mailer_preview.rb
effective_qb_sync-1.3.0 lib/generators/templates/effective_qb_sync_mailer_preview.rb
effective_qb_sync-1.2.5 lib/generators/templates/effective_qb_sync_mailer_preview.rb
effective_qb_sync-1.2.4 lib/generators/templates/effective_qb_sync_mailer_preview.rb
effective_qb_sync-1.2.3 lib/generators/templates/effective_qb_sync_mailer_preview.rb
effective_qb_sync-1.2.2 lib/generators/templates/effective_qb_sync_mailer_preview.rb
effective_qb_sync-1.2.1 lib/generators/templates/effective_qb_sync_mailer_preview.rb
effective_qb_sync-1.2.0 lib/generators/templates/effective_qb_sync_mailer_preview.rb
effective_qb_sync-1.1.5 lib/generators/templates/effective_qb_sync_mailer_preview.rb
effective_qb_sync-1.1.4 lib/generators/templates/effective_qb_sync_mailer_preview.rb
effective_qb_sync-1.1.3 lib/generators/templates/effective_qb_sync_mailer_preview.rb