class InvoiceMailer

Public Instance Methods

billing_reminder(expert_session_id) click to toggle source

Reminder email for invoice payment.

# File app/mailers/invoice_mailer.rb, line 67
def billing_reminder(expert_session_id)
  expert_session = ExpertSession.find(expert_session_id)
  @expert_session = expert_session
  @customer = expert_session.customer
  @fixxpert = expert_session.fixxpert
  mail(to: @customer.email, bcc: Configurations::General.bcc_list, subject: "Billing reminder.") do |format|
    format.html { render :layout => 'mailer' }
  end
end
create_email(invoice) click to toggle source

Send email when invoice is generated.

# File app/mailers/invoice_mailer.rb, line 10
def create_email(invoice)
  @invoice = invoice
  @fixxpert = invoice.fixxpert
  @customer = invoice.customer
  @invoiceable = invoice.invoiceable
  @invoiceable_url = invoices_url @invoiceable
  mail(to: @customer.email, bcc: Configurations::General.bcc_list, subject: "New invoice request") do |format|
    format.html { render :layout => 'mailer' }
  end
end
paid_email(invoice) click to toggle source

Send email when invoice paid.

paid_email_fixxpert(invoice) click to toggle source

Send email to fixxpert when invoice paid.

past_due_email(invoice_id) click to toggle source

Send mail to initimate user the due invoice.

# File app/mailers/invoice_mailer.rb, line 54
def past_due_email(invoice_id)
  invoice = Invoice.find(invoice_id)
  @invoice = invoice
  @fixxpert = invoice.fixxpert
  @customer = invoice.customer
  @expert_session = invoice.invoiceable
  @expert_session_url = invoices_url @expert_session
  mail(to: @customer.email, bcc: Configurations::General.bcc_list, subject: "Past due invoice.") do |format|
    format.html { render :layout => 'mailer' }
  end
end
setup_invoices_attachments() click to toggle source

Sets the invoice confirmed and cancel images in attachment.

# File app/mailers/invoice_mailer.rb, line 4
def setup_invoices_attachments
  attachments.inline['confirm.png'] = File.read(File.join(Rails.root, 'app/assets/images/confirm.png'))
  attachments.inline['cancel.png'] = File.read(File.join(Rails.root, 'app/assets/images/cancel.png'))
end
update_email(invoice) click to toggle source

Sends update email invoice to customer when invoice is updated.

# File app/mailers/invoice_mailer.rb, line 42
def update_email(invoice)
  @invoice = invoice
  @fixxpert = invoice.fixxpert
  @customer = invoice.customer
  @invoiceable = invoice.invoiceable
  @invoiceable_url = invoices_url @invoiceable
  mail(to: @customer.email, bcc: Configurations::General.bcc_list, subject: "Updated invoice request")  do |format|
    format.html { render :layout => 'mailer' }
  end
end