Merge Field Company Name
-
I am trying to send over the billing company name to MailChimp. I cannot find any documentation to tell me what is the merge field for company name. I have tried COMPANY, CNAME and COMPANYNAME. Don’t work.
function custom_user_merge_tags($merge_vars, $user) {
// Get the WooCommerce customer object
$customer = new WC_Customer($user->ID);
// Build Address Array
$address = array();
$address[“addr1”] = $customer->get_billing_address_1();
$address[“addr2”] = $customer->get_billing_address_2();
$address[“city”] = $customer->get_billing_city();
$address[“state”] = $customer->get_billing_state();
$address[“zip”] = $customer->get_billing_postcode();
$address[“country”] = $customer->get_billing_country();//Assign to MailChimp merge tag name
$merge_vars[‘ADDRESS’] = $address;
$merge_vars[‘PHONE’] = custom_format_telephone((string) $customer->get_billing_phone());
$merge_vars[‘COMPANY’] = $customer->get_billing_company();// return the merge tag array to be submitted.
return $merge_vars;
}add_filter(‘mailchimp_sync_user_mergetags’, ‘custom_user_merge_tags’, 100, 2);`
- The topic ‘Merge Field Company Name’ is closed to new replies.