Further to the above, here's where I am up to, it's not currently working...
My notification URL is:
http://xxx.xx.xxx.xx/~devs/pilates/wp-content/mu-plugins/s2-cancel-notification.php I have:
if(!empty($_GET['s2_cancel_notification']) && $_GET['s2_cancel_notification'] === 'yes')
// ↑ In my URL, I have `?s2_cancel_notification=yes`, that's what I'm looking for here.
// In my URL, I have `&user_id=%%user_id%%`, that's what I'm looking for here.
$user_id = (integer)$_GET['user_id']; // I'm expecting an integer in this value.
$user = new WP_User($user_id); // Get a WordPress User object instance so I can work with this customer.
// I could also collect details about this user, by accessing properties of my WP_User object instance.
$first_name = $user->first_name;
$last_name = $user->last_name;
$email = $user->user_email;
$username = $user->user_login;
// I could also log this transaction, by creating a log entry in a static text file on-site.
file_put_contents(WP_CONTENT_DIR.'/plugins/s2member-logs/sharelog.txt', 'Cancellation Notification Received for User ID: '.$user_id."\n", FILE_APPEND);
exit; // We can exit here. There's no reason to continue loading WordPress in this case.
I have also created a text file here: WP_CONTENT_DIR.'/plugins/s2member-logs/sharelog.txt
When I cancel a user, nothing happens, no email (despite my email address being in the Email Transaction Log field and nothing is put in my log file.
Any ideas? Thanks.