0
試圖創建使用Sendgrid API將收件人添加到聯繫人列表中的自定義聯繫人窗體,下面從https://github.com/sendgrid/sendgrid-php/blob/master/examples/contactdb/contactdb.php的例子,目前我有:Sendgrid PHP API V3聯繫人列表更新錯誤
require("sendgrid-php.php");
// Send an Email
$from = new SendGrid\Email(null, "[email protected]");
$subject = "Hello World from the SendGrid PHP Library!";
$to = new SendGrid\Email(null, "[email protected]");
$content = new SendGrid\Content("text/plain", "Hello, Email!");
$mail = new SendGrid\Mail($from, $subject, $to, $content);
$apiKey = 'API_GOES_HERE';
$sg = new \SendGrid($apiKey);
$list_id = "12345";
$recipient_id = base64_encode("[email protected]");
$listResponse = $sg->client->contactdb()->lists()->_($list_id)->recipients()->_($recipient_id)->post();
echo $listResponse->statusCode();
echo $listResponse->body();
echo $listResponse->headers();
但我m到處錯誤:
**message":"Recipient ID does not exist"**