diff --git a/app/Http/Controllers/InvoiceController.php b/app/Http/Controllers/InvoiceController.php index 04bc692b87..1db9455b66 100644 --- a/app/Http/Controllers/InvoiceController.php +++ b/app/Http/Controllers/InvoiceController.php @@ -401,7 +401,7 @@ class InvoiceController extends BaseController if ($invoice->is_recurring) { $response = $this->emailRecurringInvoice($invoice); } else { - $this->dispatch(new SendInvoiceEmail($invoice, $reminder, $pdfUpload, $template)); + $this->dispatch(new SendInvoiceEmail($invoice, $reminder, $template)); $response = true; } diff --git a/app/Jobs/SendInvoiceEmail.php b/app/Jobs/SendInvoiceEmail.php index a638b2b049..f37abac24e 100644 --- a/app/Jobs/SendInvoiceEmail.php +++ b/app/Jobs/SendInvoiceEmail.php @@ -26,11 +26,6 @@ class SendInvoiceEmail extends Job implements ShouldQueue */ protected $reminder; - /** - * @var string - */ - protected $pdfString; - /** * @var array */ @@ -44,11 +39,10 @@ class SendInvoiceEmail extends Job implements ShouldQueue * @param bool $reminder * @param mixed $pdfString */ - public function __construct(Invoice $invoice, $reminder = false, $pdfString = false, $template = false) + public function __construct(Invoice $invoice, $reminder = false, $template = false) { $this->invoice = $invoice; $this->reminder = $reminder; - $this->pdfString = $pdfString; $this->template = $template; } @@ -59,7 +53,7 @@ class SendInvoiceEmail extends Job implements ShouldQueue */ public function handle(ContactMailer $mailer) { - $mailer->sendInvoice($this->invoice, $this->reminder, $this->pdfString, $this->template); + $mailer->sendInvoice($this->invoice, $this->reminder, $this->template); } /* diff --git a/app/Ninja/Mailers/ContactMailer.php b/app/Ninja/Mailers/ContactMailer.php index 12939f5ecc..22b7e56fe7 100644 --- a/app/Ninja/Mailers/ContactMailer.php +++ b/app/Ninja/Mailers/ContactMailer.php @@ -36,7 +36,7 @@ class ContactMailer extends Mailer * * @return bool|null|string */ - public function sendInvoice(Invoice $invoice, $reminder = false, $pdfString = false, $template = false) + public function sendInvoice(Invoice $invoice, $reminder = false, $template = false) { if ($invoice->is_recurring) { return false; @@ -61,8 +61,9 @@ class ContactMailer extends Mailer $emailSubject = !empty($template['subject']) ? $template['subject'] : $account->getEmailSubject($reminder ?: $entityType); $sent = false; + $pdfString = false; - if ($account->attachPDF() && ! $pdfString) { + if ($account->attachPDF()) { $pdfString = $invoice->getPDFString(); } diff --git a/resources/views/invoices/edit.blade.php b/resources/views/invoices/edit.blade.php index db359f3379..0ca382e712 100644 --- a/resources/views/invoices/edit.blade.php +++ b/resources/views/invoices/edit.blade.php @@ -1308,25 +1308,6 @@ $('#emailModal div.modal-footer button').attr('disabled', true); model.invoice().is_public(true); submitAction('email'); - - /* - var accountLanguageId = parseInt({{ $account->language_id ?: '0' }}); - var clientLanguageId = parseInt(model.invoice().client().language_id()) || 0; - var attachPDF = {{ $account->attachPDF() ? 'true' : 'false' }}; - - // if they aren't attaching the pdf no need to generate it - if ( ! attachPDF) { - submitAction('email'); - // if the client's language is different then we can't use the browser version of the PDF - } else if (clientLanguageId && clientLanguageId != accountLanguageId) { - submitAction('email'); - // if queues are enabled we need to use PhantomJS - } else if ({{ config('queue.default') != 'sync' ? 'true' : 'false' }}) { - submitAction('email'); - } else { - preparePdfData('email'); - } - */ } function onSaveDraftClick() {