Open Macbenach opened 6 years ago
@bryglen, there is a way to solve this, did you prefer @Macbenach and me make a PR?
this is a known issue on 7.2, as of now no support for 7.2
@bryglen dude, plz upgrade your composer.json at least 6.++, see reference https://github.com/sendgrid/sendgrid-php/releases, you library are to old, plz make the update.
Hello @bryglen what you think about this snippet
public function getHeadersJson() {
if ($this->getHeaders() == NULL) {
return "{}";
}
if (count($this->getHeaders()) <= 0) {
return "{}";
}
return json_encode($this->getHeaders(), JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP);
}
Maybe exist some better code but it seems to solve the problem in php 7.2, i test it in PHP 7.2 and 7.0
@bryglen, help us
please create PR
Hello guys, Can use this package https://github.com/ramprasadm1986/yii2-sendgrid
When send email apperace this error after update my server to PHP 7.2
message: count(): Parameter must be an array or an object that implements Countable"
file: "/var/www/html/tfd_rh_api/vendor/sendgrid/sendgrid/lib/SendGrid/Email.php"
References:
https://github.com/yiisoft/yii/issues/4167 https://github.com/Automattic/jetpack/issues/8420 https://github.com/invoiceninja/invoiceninja/issues/1767