【发布时间】:2016-10-25 11:59:19
【问题描述】:
我想通过 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]);
}
【问题讨论】:
-
欢迎来到 SO。请查看the tour。您可能还想查看What topics can I ask about、How to ask a good question 和The perfect question,以及如何创建Minimal, Complete and Verifiable example。发布您尝试过的代码和您收到的错误。尽可能具体,因为它会带来更好的答案。
-
请使用您的代码编辑您的帖子,以便我们更轻松、更快捷,谢谢!