几天来,我一直试图弄清楚这一点。我设法获得以下代码来创建潜在客户并添加名称,但由于某种原因它拒绝添加电子邮件地址。我已检查并仔细检查$_POST['email']
是否已设置并正常工作。
$soapclient = new nusoap_client('http://www.domain.com/crm/soap.php?wsdl',true);
$user_auth = array( 'user_auth' => array( 'user_name' => 'user', 'password' => md5('pass'), 'version' => '0.1' ), 'application_name' => 'soapleadcapture');
$result_array = $soapclient->call('login',$user_auth);
$session_id = $result_array['id'];
$user_guid = $soapclient->call('get_user_id',$session_id);
$err = $soapclient->getError();
if ($err) {
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
}
$name=$_POST['name'];
$nameParts = explode(' ',$name,2);
$firstName = $nameParts[0];
$lastName = $nameParts[1];
$email = $_POST['email'];
// create lead
$set_entry_params = array(
'session' => $session_id,
'module_name' => 'Leads',
'name_value_list'=>array(
array('name'=>'first_name','value'=>$firstName),
array('name'=>'last_name','value'=>$lastName),
array('name'=>'status', 'value'=>'New'),
array('name'=>'phone_work', 'value'=>$phone),
array('name'=>'primary_address_city', 'value'=>$city),
array('name'=>'account_name','value'=>$acc),
array('name'=>'email','value'=>$email),
array('name'=>'lead_source','value'=>'Web Site'),
array('name'=>'description','value'=>$desc),
array('name'=>'team_id', 'value'=> '1'),
array('name'=>'assigned_user_id', 'value'=>$user_guid)
)
);
$result = $soapclient->call('set_entry',$set_entry_params);
任何帮助弄清楚为什么它不会提交电子邮件地址将不胜感激。