Gossamer Forum
Home : Products : Gossamer Mail : Discussion :

Easy way to delete users from email links?

Quote Reply
Easy way to delete users from email links?
Is it possible to delete a user from a link in email? I charge for my service and one or two, after signing up, don't go on to pay. These soon mount up and it's a pain cut and pasting their address from the emails into the admin and deleting them manually. I wondered when you receive the "new user has signed up" email, whether it's possible to adpapt the URL, or have a ready made URL, that when combined with the users address will delete them when clicked?

Even if I have to login first, if I then use the same URL format with the address of the user, is it going to be possible to delete them, without having to paste their address each time?

Jason
Quote Reply
Re: [wickedmoon] Easy way to delete users from email links? In reply to
Just been looking at the "delete" URLs for this myself in admin. Is the User ID absolutely required to delete a user? Is this information that could be emailed when being notified of new signups?

Jason
Quote Reply
Re: [wickedmoon] Easy way to delete users from email links? In reply to
You do need the userid. You can 'fix' this (I'll add it to 2.1.1), by adding the userid to the available variables. Take a look at admin/NoAuth/Join.pm line ~117, and add:
Code:
$cgi->{userid} = $id->{$p . 'users.userid'};
just before the call to notify admin.

Then in the admin.eml, you can add a link like:
Code:
<%url_admin%>/admin.cgi?email=<%email%>;userid=<%userid%>;page=user_confirm.html

Adrian
Quote Reply
Re: [brewt] Easy way to delete users from email links? In reply to
I edited the code to look like this:

Code:
my $t = GMail->template_set;
$cgi->{userid} = $id->{$p . 'users.userid'};
my $mail = $self->parse_message("$CFG->{location}->{path}->{data}/templates/$t/register.eml", $self->get_tags({key => $key}), $cgi);
my $email = '';

But all I get is an Internal Error on the sign up page.

Any ideas?

Jason

Last edited by:

telemachus: Jun 13, 2002, 2:21 AM
Quote Reply
Re: [wickedmoon] Easy way to delete users from email links? In reply to
I see you're still using 2.0.6. That's not the right place to put that code. You want to look further up in the code, in sub add. Insert it right before line:
Code:
GMail::NoAuth::Join->notify_admin($cgi);
so, it's something like:
Code:
# Send them and email if we are doing email validation
if ($CFG->{email}->{notify_admin}) {
$cgi->{userid} = $id->{$p . 'users.userid'};
GMail::NoAuth::Join->notify_admin($cgi);
}

Adrian
Quote Reply
Re: [brewt] Easy way to delete users from email links? In reply to
Perfect, works a treat. This works exactly as it would have done if I'd searched and deleted manually from admin?

Jason
Quote Reply
Re: [wickedmoon] Easy way to delete users from email links? In reply to
Yep.

Adrian