###前提・実現したいこと
contact form 7を使用して、登録時にメール送信+salesforceに登録がしたい。
###発生している問題・エラーメッセージ
以下のサイトを参考に作ってみたのですが、salesforceのリード画面を更新しても何も入らなくて号泣しています。
https://daddyanalytics.com/integrating-contact-form-7-and-salesforce/
###該当のソースコード
add_action( 'wpcf7_before_send_mail', 'my_conversion' );
function my_conversion( $cf7 )
{
$first_name = $cf7->posted_data["your-name"];
$last_name = $cf7->posted_data["your-namefirigana"];
$company= $cf7->posted_data["your-occupation-name"];
$post_items[] = 'oid=00D28000XXXXXXX';
$post_items[] = 'first_name=' . $first_name;
$post_items[] = 'last_name=' . $last_name;
$post_items[] = 'company=' . $company;
if(!empty($first_name) && !empty($last_name) && !empty($company) )
{
$post_string = implode ('&', $post_items);
// Create a new cURL resource
$ch = curl_init();
if (curl_error($ch) != "")
{
// error handling
$error = '接続できません';
$cf7->invalidate($error);
}
else
{
$con_url = 'https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8';
curl_setopt($ch, CURLOPT_URL, $con_url);
// Set the method to POST
curl_setopt($ch, CURLOPT_POST, 1);
// Pass POST data
curl_setopt( $ch, CURLOPT_POSTFIELDS, $post_string);
curl_exec($ch); // Post to Salesforce
curl_close($ch); // close cURL resource
}
}
return $cf7;
}
###補足情報(言語/FW/ツール等のバージョンなど)
※Brilliant Web-to-Lead for Salesforceはインストールしています。
→設定はoidしかしていません。
※salesforceもwordpressもはじめたばかりです。

バッドをするには、ログインかつ
こちらの条件を満たす必要があります。