我想通过 Hubspot API 一次添加多封电子邮件。我使用了一个 foreach 循环来添加电子邮件,但是 30 秒后,它显示超出了执行时间。是否有通过 Hubspot API 添加属性的批量方法?
foreach ($leads as $lead) {
$data['email'] = $lead['email'];
$data['firstname'] = $lead['name'];
$hubspot = new HubSpot($autoDetails[3]->api_creds_required);
$hubspot->contacts()->create_contact($data);
$email = $hubspot->contacts()->get_contact_by_email($lead['email']);
$result = $hubspot->lists()->add_contacts_to_list($email->vid, $autoDetails[0]);
}