mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-05 18:52:44 +01:00
Fixes for attachments with gmail
This commit is contained in:
parent
5f3efdc5ff
commit
64351e0f0a
@ -65,11 +65,6 @@ class GmailTransport extends Transport
|
||||
nlog("trying to attach");
|
||||
nlog($child->getContentType());
|
||||
|
||||
// $attachment = (new Swift_Attachment())
|
||||
// ->setFilename('my-file.pdf')
|
||||
// ->setContentType('application/pdf')
|
||||
// ->setBody($data)
|
||||
// ;
|
||||
|
||||
if($child->getContentType() != 'text/plain'){
|
||||
|
||||
@ -80,6 +75,26 @@ class GmailTransport extends Transport
|
||||
}
|
||||
|
||||
|
||||
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();
|
||||
|
Loading…
Reference in New Issue
Block a user