Created
January 17, 2018 07:43
-
-
Save travislima/c368b370a3c3ae8f58020bde7fec9307 to your computer and use it in GitHub Desktop.
PMPro add custom fields to email
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Adds !!company!! as an available variable for use in Paid Memberships Pro emails. | |
Notice the array key does not include the !!s | |
*/ | |
function my_pmpro_email_data($data, $email) | |
{ | |
global $current_user; | |
$data['company'] = get_user_meta($current_user->ID, 'company', false); | |
return $data; | |
} | |
add_filter("pmpro_email_data", "my_pmpro_email_data", 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment