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
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
Send email when invoice paid.
# File app/mailers/invoice_mailer.rb, line 22 def paid_email(invoice) @invoice = invoice @payer = invoice.user @payee = invoice.fixxpert mail(to: @payer.email, bcc: Configurations::General.bcc_list, subject: "Invoice Paid") do |format| format.html { render :layout => 'mailer' } end end
Send email to fixxpert when invoice paid.
# File app/mailers/invoice_mailer.rb, line 32 def paid_email_fixxpert(invoice) @invoice = invoice @payer = invoice.user @payee = invoice.fixxpert mail(to: @payee.email, bcc: Configurations::General.bcc_list, subject: "Invoice Paid") do |format| format.html { render :layout => 'mailer' } end end
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
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
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