Update 'src/Providers/SendinblueProvider.php'

This commit is contained in:
Maxime 2023-01-14 19:12:34 +01:00
parent b5e447ed15
commit 451789b71a
1 changed files with 9 additions and 2 deletions

View File

@ -69,8 +69,15 @@ class SendinblueProvider implements TemplateMailProvider
if (! empty($data['attachments'])) {
$model->setAttachment(array_map(function ($item) {
$attachment = new SendSmtpEmailAttachment();
$attachment->setName($item['filename']);
$attachment->setContent(file_get_contents($item['path']));
if (isset($item['filename']))
$attachment->setName($item['filename']);
if (strpos($item['path'], 'http') === 0)
$attachment->setUrl($item['path']);
else
$attachment->setContent(file_get_contents($item['path']));
return $attachment;
}, $data['attachments']));
}