From: Louis Jeckel Date: Mon, 18 Jan 2021 17:23:36 +0000 (+0100) Subject: email batch view defaults to PDF to prevent error on batches that don't have a Conten... X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=7ce830f700197b518693e119822824b7e7dba0b0;p=psq.git email batch view defaults to PDF to prevent error on batches that don't have a Content.TYPE --- diff --git a/app/EmailBatch.php b/app/EmailBatch.php index ad5fe30..2978b84 100644 --- a/app/EmailBatch.php +++ b/app/EmailBatch.php @@ -3,7 +3,7 @@ namespace App; use App\Mail\BatchMail; -use Arr; +use Illuminate\Support\Arr; use Carbon\Carbon; use Illuminate\Database\Eloquent\Model; use \Illuminate\Database\Eloquent\Relations; @@ -167,7 +167,7 @@ class EmailBatch extends TwillModel */ public function getView() { - if($this->content['type'] == 1) { + if(Arr::get($this->content, 'type', 1) == 1) { return BatchMail::MAIL_TYPE_PDF_FILE; } return BatchMail::MAIL_TYPE_NEWSLETTER;