Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[WooCommerce Drip] This filter allows you to customize the subscriber custom fields sent to Drip. This is an example of sending the first and last names instead of a general full name:
add_filter( 'wcdrip_custom_fields', 'drip_add_first_last_fields', 10, 5 );
function drip_add_first_last_fields( $filters, $email, $lifetime_value, $products, $order ) {
unset( $filters['name'] );
$filters['first_name'] = $order->billing_first_name;
$filters['last_name'] = $order->billing_last_name;
return $filters;
}
@rezzz-dev

This comment has been minimized.

Copy link

rezzz-dev commented Apr 3, 2019

If I'm looking to grab an additional field that is a checkbox, how would I do that to pass along into Drip as a custom field?

I'm testing this along with the first_name and it's not storing the first_name either, so either this no longer works or I'm not doing something correctly.

Any thoughts/help would be appreciated, thank you in advance!

@keegancc

This comment has been minimized.

Copy link

keegancc commented Jun 29, 2019

Hi, Im using the filter wcdrip_custom_fields in order to send custom values to drip. But one thing that I noticed is that this only works if a returning customer has purchased a product from my site. But if the customer purchases something for the very first time the custom info is not sent to drip.

Any help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.