diff --git a/app/Helpers/Mail/GmailTransport.php b/app/Helpers/Mail/GmailTransport.php index 9473f6c106a8..64770de41e8c 100644 --- a/app/Helpers/Mail/GmailTransport.php +++ b/app/Helpers/Mail/GmailTransport.php @@ -65,13 +65,36 @@ class GmailTransport extends Transport nlog("trying to attach"); nlog($child->getContentType()); + if($child->getContentType() != 'text/plain'){ - $this->gmail->attach(TempFile::filePath($child)); + nlog($child->getHeaders()); + $this->gmail->attach(TempFile::filePath($child)); + } + foreach ($message->getChildren() as $child) { + nlog("trying to attach"); + + if($child->getContentType() != 'text/plain'){ + +// $attachment = (new Swift_Attachment()) +// ->setFilename($child->getHeaders()->get('Content-Type')->getParameter('name')) +// ->setContentType($child->getContentType()) +// ->setBody($child->getBody()); + + $this->gmail->attach(new Swift_Attachment($child)); + + } + + + } //todo this should 'just work' + + + + } //todo this should 'just work' $this->gmail->send();