Skip to content

Instantly share code, notes, and snippets.

@travislima
Created January 17, 2018 07:43
Show Gist options
  • Save travislima/c368b370a3c3ae8f58020bde7fec9307 to your computer and use it in GitHub Desktop.
Save travislima/c368b370a3c3ae8f58020bde7fec9307 to your computer and use it in GitHub Desktop.
PMPro add custom fields to email
/*
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