Hi, this thread https://premium.wpmudev.org/forums/topic/pings-on-membership-1#post-243844 has been going on for a couple of weeks and is just sitting there so here is the update on my progress and what still needs to be fixed…
Site set up:
membership plugin site by site install on a multisite set up.
I am trying to send a message to the subsite admin when a user changes his membership level. I am trying to do this through a joining ping.
I am also trying to send the blog user whose membership level is changed an email message.
VeBailovity gave me this code in chat today, it uses the post method. (email@example.com is replaced with my site email address)
//Hook up to WordPress
$current_user = wp_get_current_user();
$admin_email = get_bloginfo(‘admin_email’:wink:;
$user_email = $current_user->user_email;
$to = $user_email . ‘,’ . $admin_email;
$subject = ‘Membership Message’;
$headers = “From: firstname.lastname@example.org“;
$headers .= ‘MIME-Version: 1.0’ . “rn”;
$headers .= ‘Content-type: text/html; charset=iso-8859-1’ . “rn”;
$message = “Blog url: “.$_POST.”
Membership Level: “.$_POST.”
mail($to, $subject, $message, $headers);
The from address works but the super admin, not the blog user or the subsite admin receives the message. I tried this logged in as the blog user and also logged in as the subsite admin. Both times only the super admin gets the message.
How do I send the emails to the relevant subsite admin and blog user?