]> _ Git - psq.git/commitdiff
email batch view defaults to PDF to prevent error on batches that don't have a Conten...
authorLouis Jeckel <louis.jeckel@outlook.com>
Mon, 18 Jan 2021 17:23:36 +0000 (18:23 +0100)
committerLouis Jeckel <louis.jeckel@outlook.com>
Mon, 18 Jan 2021 17:23:36 +0000 (18:23 +0100)
app/EmailBatch.php

index ad5fe309dc104d468ef69ab80bdcb45c660119a2..2978b84c1fad107bd590185a0507f28cf27db3e0 100644 (file)
@@ -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;