- π³π±Netherlands Rop Rotterdam
I think a better way would be to use the Postmark\Models\PostmarkAttachment; within PostmarkMail.php
use Postmark\Models\PostmarkAttachment;
add something like this:
// Make sure the files provided in the attachments array exist. if (!empty($message['params']['attachments'])) { $attachments = $this->convertAttachmentsToPostmarkObjects($message['params']['attachments']); if (count($attachments) > 0) { $postmark_message['attachments'] = $attachments; } }
protected function convertAttachmentsToPostmarkObjects($attachments){ $postmark_attachments = []; foreach ($attachments as $attachment) { if (file_exists($attachment['filepath'])) { $postmark_attachments[] = PostmarkAttachment::fromFile($attachment['filepath'], $attachment['filename'], $attachment['filemime']); } } return $postmark_attachments; }
- πΊπΈUnited States mralexho
Ran into this issue today. Created a patch from #3 π Messages with file attachments fail to send Needs review comments. Attachments are working successfully now.