需要帮助将wordpress注册表连接到infusionsoft吗
我对这一切都是新手,我试着搜索自己,但没有找到我需要的。我需要将默认WordPress注册表连接到infusionsoft。因此,每次新会员注册时,我都会在infusionsoft的联系人列表中找到他们的电子邮件地址。希望我解释正确。请随意编辑我的问题。您需要设置的内容很多,因此我将略过您在解决问题之前需要做的事情。我已经添加了一些链接,你可以随时参考 您首先需要的是Infusionsoft的PHP SDK。如果不确定如何设置,请参阅以下内容: 在Wordpress管理仪表板中将身份验证位创建为菜单页 确定身份验证后,可以将生成的访问令牌保存到Infusionsoft API中,作为WordPress中的一个选项。使用和保存插件/主题中API调用的访问令牌 之后,您需要使用用户注册后调用的用户注册钩子进行API调用,最终将注册详细信息发送到infusionsoft:需要帮助将wordpress注册表连接到infusionsoft吗,wordpress,forms,registration,infusionsoft,Wordpress,Forms,Registration,Infusionsoft,我对这一切都是新手,我试着搜索自己,但没有找到我需要的。我需要将默认WordPress注册表连接到infusionsoft。因此,每次新会员注册时,我都会在infusionsoft的联系人列表中找到他们的电子邮件地址。希望我解释正确。请随意编辑我的问题。您需要设置的内容很多,因此我将略过您在解决问题之前需要做的事情。我已经添加了一些链接,你可以随时参考 您首先需要的是Infusionsoft的PHP SDK。如果不确定如何设置,请参阅以下内容: 在Wordpress管理仪表板中将身份验证位创建
add_action( 'user_register', 'user_to_infusionsoft', 10, 1 );
function user_to_infusionsoft($user_id){
//Include your infusionsoft PHP SDK path if you haven't already
$infusionsoft = $infusionsoft = new \Infusionsoft\Infusionsoft(array(
'clientId' => 'Your API key goes here',
'clientSecret' => 'Your API secret goes here',
'redirectUri' => 'http://yourwebsite.com/authentication.php',
));
//Retrieve the access token that you generated and saved from the options
$token = get_option('infusionsoft_token');
$infusionsoft->setToken(unserialize($token));
$user_info = get_userdata($user_id);
//Set up the email in the format to be used by the API
$user_email = new \stdClass;
$user_email->field = 'EMAIL1';
$user_email->email = $user_info->user_email;
$contact = ['given_name' => $user_info->first_name, 'family_name' => $user_info->last_name, 'email_addresses' => [$user_email]];
$infusionsoft->contacts()->create($contact);
}