Skip to main content
Question

Transferring Custom Fields from Paid Memberships Pro to Zapier Using Code Snippets

  • October 25, 2024
  • 0 replies
  • 45 views

I am using Paid Memberships Pro on Wordpress and would like to transfer information to emailoctopus via Zapier. I would like to include custom PMPro fields in this transfer. While this thread suggests that this is not currently supported by Zapier, PMPro documentations suggests that code snippets in Wordpress can be used to send custom fields to Zapier - see this gated PMPro article. The code for this article can be found here

I adapted this code and added it through the Code Snippets plugin - see code below. I added the sponsor_name field manually to PMPro checkout forms. When testing the Zap (with PMPro directly, not a custom webhook), the custom field is not visible. 

Does Zapier allow custom fields from PMPro through Wordpress code? If so, how do I enable this?

Thank you!

function pmpro_add_custom_data_to_zapier( $data, $user_id, $level, $order ) {

    $data['sponsor_name']   = get_user_meta( $user_id, 'sponsor_name', true );

    return $data;

}

add_filter( 'pmproz_added_order_data', 'pmpro_add_custom_data_to_zapier', 10, 4 );

Did this topic help you find an answer to your question?
This post has been closed for comments. Please create a new post if you need help or have a question about this topic.