Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function gens_raf_customer_email( $order, $sent_to_admin, $plain_text ) {
- $user_id = $order->customer_user;
- if( ! empty( $user_id ) && ( $code = get_user_meta($user_id, "gens_referral_id", true) ) != '' ){
- if( $plain_text ){
- echo 'Your referral code is: ' . $code;
- } else {
- echo '<p>Your referral code is: ' .get_home_url() .'?raf='. $code . '</p>';
- }
- }
- }
- add_action('woocommerce_email_customer_details', 'gens_raf_customer_email', 30, 3 );
Add Comment
Please, Sign In to add comment