请使用Sendinblue API从我的LARAVEL应用程序中每天发送一组数据[这是外部服务器API看起来像( api.sendinble.com/v3/ contact /)的样子],我已经成功地使用了Sendinblue PHP代码在时间上发送了一个联系人。
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sendinblue.com/v3/contacts/identifier",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "{\"attributes\":{\"newKey\":\"New Value\"}}",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"Content-Type: application/json",
"api-key: My API"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
?>我的问题是,有一种方式可以同时发送所有数据,每天自动发送吗?
我应该在控制器中对每个人使用a,还是有其他方法?
提前谢谢你。
发布于 2021-02-18 16:36:54
是的,你可以用Laravel调度器来完成。
https://stackoverflow.com/questions/66264047
复制相似问题