Additional merge tags
-
Instructions on Github suggests that we are able to add additional merge tags using
mailchimp_sync_user_mergetags
filter.This does not seem to work
I have tried submitting both, dynamic and hard-coded values such as this:
$mergeVars['MMERGE5'] = 'Demo';
$mergeVars['EMOPTIN'] = 'Yes'
;Merge tags
MMERGE5
andEMOPTIN
exist on Mailchimp side but are ignored (not populated).Full Example:
function addCustomMergeTags($mergeVars, $user) { $customer = new WC_Customer($user->ID); if ($customer) { ... $mergeVars['SALUTATION'] = 'MR'; } return $mergeVars; } add_filter('mailchimp_sync_user_mergetags', 'addCustomMergeTags', 100, 2);
Tried the above without the logic for the
customer
as well.Also ensured that the function returns array ( temporarily returned false and could see the following message in the log ).
The filter for mailchimp_sync_user_mergetags needs to return an array, using the default setup instead.
The above means that the filter was executed when expected.
All other default fields ( name, surname and email ) are working as expected. The problem is when you need to map custom merge tags.
Is this supported at all? Is there a way to check what is being sent to Mailchimp?
- The topic ‘Additional merge tags’ is closed to new replies.