Changed PDF attachment to use private id

This commit is contained in:
Hillel Coren 2015-03-24 18:07:48 +02:00
parent 7662729570
commit 13994f98a8

View File

@ -25,7 +25,7 @@ class Mailer
$invoice = Invoice::find($data['id']); $invoice = Invoice::find($data['id']);
$invoice->load('account'); $invoice->load('account');
$accountAttributes = $invoice->account()->getParent()->getRelations()['account']->getAttributes(); $accountAttributes = $invoice->account()->getParent()->getRelations()['account']->getAttributes();
$pdfPath = storage_path().'/pdfcache/cache-'.$invoice->getAttributes()['public_id'].'.pdf'; $pdfPath = storage_path().'/pdfcache/cache-'.$invoice->id.'.pdf';
if($accountAttributes['pdf_email_attachment'] === 1 && file_exists($pdfPath)) { if($accountAttributes['pdf_email_attachment'] === 1 && file_exists($pdfPath)) {
$message->attach( $message->attach(