feature/add-attachments #2

Manually merged
Thifaine merged 12 commits from feature/add-attachments into master 2020-06-09 16:20:07 +02:00
1 changed files with 0 additions and 20 deletions
Showing only changes of commit 6c1aedd2ae - Show all commits

View File

@ -37,7 +37,6 @@ class BluescaleMailApi
$notifiable_recipient = false;
$notifiable_email = $notifiable->email;
$recipients = $template->recipients;
$attachments = $template->attachments;
if (count($recipients) > 0)
foreach ($recipients as $recipient)
@ -50,27 +49,8 @@ class BluescaleMailApi
'address' => $notifiable->email
];
}
$files = [];
if (count($attachments) > 0)
foreach ($attachments as $attachment)
$files[] = [
'name' => $attachment['name'],
'contents' => $attachment['content'],
'filename' => $attachment['filename'],
];
try {
if (count($attachments) > 0) {
return $client->request('post', $url, [
'multipart' => $files,
'form_params' => $template,
'headers' => [
'Authorization' => 'Bearer ' . $this->api_key,
'Accept' => 'application/json'
]
])->getBody();
}
return $client->request('post', $url, [
'form_params' => $template,
'headers' => [