]> _ Git - psq.git/commitdiff
Update BatchMail.php
authorLouis Jeckel <louis.jeckel@outlook.cm>
Thu, 8 Oct 2020 07:58:21 +0000 (09:58 +0200)
committerLouis Jeckel <louis.jeckel@outlook.cm>
Thu, 8 Oct 2020 07:58:21 +0000 (09:58 +0200)
app/Mail/BatchMail.php

index 40bdbbe119bb33f5648146f7b8df872e4ce860a5..69a05fe9acc66c48baa6fe400e688619167defc2 100644 (file)
@@ -49,12 +49,17 @@ class BatchMail extends Mailable
     public function __construct($content, $subject, $type, $link = null, $image = null)
     {
         //
-        $this->content = preg_replace('/<img/', '<img width="600"', $content);
         $this->subject = $subject;
         $this->link = $link;
         $this->image = $image;
 
+
         $this->emailView = Arr::get($this->viewMap, $type ?? 0);
+
+        $this->content = $this->emailView === 'batch-pdf' ?
+            (Html2Markdown::convert($content)) :
+            preg_replace('/<img/', '<img width="600"', $content);
+
         if($this->emailView === null) {
             throw new \InvalidArgumentException('Invalid email type !');
         }