-
- 73 Posts
Didn't really find anything in my google searching.
On this site, we will have paid memberships to the site. though when a user decides to cancel and delete their account. how does one go about deleting their login from a snippet ( webhook ) As the payment processor, will send the sites webhook a event when the user has deleted / canceled their subscriptions
I guess worse case, could have it auto send the admin a email with user info to go in and delete from manager. just seems like there should be a way to automate this process.
-
- 5,888 Posts
Is the user logged in, at the time he cancels his account?
Or what is the whole process about it?
-
- 73 Posts
yes the user is logged in at the time he cancels his account. presses the deltete account form button, which then does some stripe.com processing. then webhook gets a event from stripe saying the users subscription has been deleted ( so CC doesn't get charged anymore). at which point the webhook fires off a email to the user, and removes the the user form any groups.
but i have yet to find out how to delete a user from modx, using a snippet.
-
- 5,888 Posts
basically, someting like that should do that:
if ($user = $modx->getObject('modUser', $modx->getLoginUserID('web'))) {
$user->remove();
}