Closed l-alexandrov closed 2 years ago
Currently when we pass an element with attachments key in the array to the sendgrid method and send the email we receive:
attachments
sendgrid
array_merge(): Argument #1 must be of type array, null given /srv/some-fancy-app/vendor/s-ichikawa/laravel-sendgrid-driver/src/Transport/SendgridTransport.php(243): array_merge() 1 /srv/some-fancy-app/vendor/s-ichikawa/laravel-sendgrid-driver/src/Transport/SendgridTransport.php(76): Sichikawa\LaravelSendgridDriver\Transport\SendgridTransport->setParameters() 2 /srv/some-fancy-app/vendor/symfony/mailer/Transport/AbstractTransport.php(68): Sichikawa\LaravelSendgridDriver\Transport\SendgridTransport->doSend() 3 /srv/some-fancy-app/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php(521): Symfony\Component\Mailer\Transport\AbstractTransport->send()
array_merge(): Argument #1 must be of type array, null given
/srv/some-fancy-app/vendor/s-ichikawa/laravel-sendgrid-driver/src/Transport/SendgridTransport.php(243): array_merge()
Example code:
public function build() { $sendGridPayload = [ 'attachments' => ['content' => '...', 'filename' => '...', 'type' => '...'] ]; return $this ->subject('...') ->sendgrid($sendGridPayload); }
I think the issue is when adding support to Laravel 9 you've removed the attachments class member initialization and now it remains uninitalized.
Merged it and tagged 4.0.1. Thank you for fixed!
4.0.1
Currently when we pass an element with
attachments
key in the array to thesendgrid
method and send the email we receive:Example code:
I think the issue is when adding support to Laravel 9 you've removed the
attachments
class member initialization and now it remains uninitalized.