Class: Effective::QbOnlineMailer

Inherits:
Object
  • Object
show all
Includes:
EffectiveMailer
Defined in:
app/mailers/effective/qb_online_mailer.rb

Instance Method Summary collapse

Instance Method Details

#sync_error(resource, opts = {}) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/mailers/effective/qb_online_mailer.rb', line 5

def sync_error(resource, opts = {})
  raise('expected an Effective::QbReceipt') unless resource.kind_of?(Effective::QbReceipt)

  @qb_receipt = resource
  @order = resource.order

  to = EffectiveOrders.qb_online_sync_error_recipients.presence || EffectiveOrders.mailer_admin
  cc = EffectiveQbOnline.sync_error_cc_recipients.presence

  subject = subject_for(__method__, "Quickbooks Sync Error - Order ##{@order.to_param}", resource, opts)
  headers = headers_for(resource, opts)

  mail(to: to, cc: cc, subject: subject, **headers)
end