From 03b3f9a276f4b2f01d2d89fced924aceedac44f2 Mon Sep 17 00:00:00 2001 From: Maciej Szlosarczyk Date: Thu, 20 Sep 2018 13:39:35 +0300 Subject: [PATCH] Make the check against billing email set from form --- app/mailers/invoice_mailer.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/mailers/invoice_mailer.rb b/app/mailers/invoice_mailer.rb index c3eb20f6f..7f19deb0b 100644 --- a/app/mailers/invoice_mailer.rb +++ b/app/mailers/invoice_mailer.rb @@ -4,8 +4,10 @@ class InvoiceMailer < ApplicationMailer def invoice_email(invoice_id, html, billing_email) @invoice = Invoice.find_by(id: invoice_id) billing_email ||= @invoice.billing_email + logger.info "Billing email from form: #{billing_email}" + logger.info "Billing email from invoice database: #{@invoice.billing_email || nil}" return unless @invoice - return if whitelist_blocked?(@invoice.billing_email) + return if whitelist_blocked?(billing_email) kit = PDFKit.new(html) pdf = kit.to_pdf