Replies: 0
I have made a custom function which is sending revenue data to tracking tool when subscription payment is successful.
The problem I have is that I don’t know how to obtain order details, and user email inside the hook function.
Here is my function (functions.php);
add_action('woocommerce_subscription_payment_complete','mixpanel_revenue_tracking', 10, 1);
function mixpanel_revenue_tracking($subscription) {
// need to collect that data here
$subscriptionName = ;
$ordertotal = ;
$userEmail = ;
}
Any ideas? Tried that code but its not working :
$email = $subscription ->billing_email;
$total = $subscription->get_total();