我正在使用mailgun。但是,当我试图从邮件列表更新用户时,我得到了错误(无效资源类型:数组)。我的密码是低沉的。
$client = new \Http\Adapter\Guzzle6\Client();
$mgClient = new \Mailgun\Mailgun('YOUR_API_KEY', $client);
$listAddress = 'LIST@YOUR_DOMAIN_NAME';
$memberAddress = 'bob@example.com';
# Issue the call to the client.
$result = $mgClient->put("lists/$listAddress/members/$memberAddress", array(
'subscribed' => 'no',
'name' => 'Foo Bar'
));发布于 2016-06-24 04:18:02
首先,确保您使用的是php-http/guzzle6-adapter的最后一个版本,然后尝试以下操作:
$client = \Http\Adapter\Guzzle6\Client::createWithConfig([
'headers' => [
'Content-Type' => 'application/x-www-form-urlencoded'
]
]);
$mgClient = new \Mailgun\Mailgun('YOUR_API_KEY', $client);
$listAddress = 'LIST@YOUR_DOMAIN_NAME';
$memberAddress = 'bob@example.com';
# Issue the call to the client.
$result = $mgClient->put("lists/$listAddress/members/$memberAddress", http_build_query([
'subscribed' => 'no',
'name' => 'Foo Bar'
]));https://stackoverflow.com/questions/37771308
复制相似问题