Skip to content

Send function error after upgrade to 4.1.2 #170

Closed
@oaloria

Description

@oaloria

Hi, I just upgraded from version 4.1.1 to 4.1.2 and noticed that the send function is erroring because of the new type declarations introduced in this version.

Something like this is no longer working.

$sendgrid = new \SendGrid($apiKey);
$email = new Mail(
            new From($this->fromMail, $this->fromName),
            new To($sendTo),
            'Test Email'
        );
$email->addContent('text/plain', 'This is the plain text content of the email.');

$response = $sendgrid->send($email);

The error it shows says:

SendGrid\Client::makeRequest): Argument #3 ($body) must be of type ?array, SendGrid\Mail\Mail given, called in /var/www/html/src/vendor/sendgrid/php-http-client/lib/Client.php on line 662

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions