From 6c1aedd2ae54a6714ca63660b740dfbd07edf3f7 Mon Sep 17 00:00:00 2001 From: Thifaine Noirault Date: Fri, 29 May 2020 17:32:21 +0200 Subject: [PATCH] feat: forward attachments instead --- src/BluescaleMailApi.php | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/src/BluescaleMailApi.php b/src/BluescaleMailApi.php index 5d70882..3a3cfbd 100644 --- a/src/BluescaleMailApi.php +++ b/src/BluescaleMailApi.php @@ -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' => [