View Full Version : Email notification of usergroup join requests
I put this together to help my board usergroup leaders keep track of incoming join requests, and thought it might be useful to others.
I just added some code to profile.php immediately above the line "// insert the request":
$leaders = $DB_site->query("
SELECT ugl.userid, username, email
FROM " . TABLE_PREFIX . "usergroupleader AS ugl
INNER JOIN " . TABLE_PREFIX . "user AS user USING(userid)
WHERE ugl.usergroupid = $usergroupid
");
while ($leader = $DB_site->fetch_array($leaders))
{
vbmail($leader["email"], "new forums usergroup join request",
"A Forums user has asked to join a usergroup that you lead.\nPlease handle it at http://www.domain.com/forums/profile.php?do=editusergroups",
true);
}
This is rather quick and dirty, but it does seem to work well for our purposes. Perhaps others can improve on it.
Milorad
08-25-2004, 06:00 AM
this is really cool, but for my purposes would be better if it could send a PM
Would someone consider a modification to this to make that happen?
Thanks for this efoo, really useful submission!
Phalynx
08-25-2004, 07:32 AM
Nice work!
???`S?LV?R???`
08-25-2004, 07:34 AM
nice.. looks like i might have some use for this
scoheb
10-22-2004, 06:08 PM
Is there a way to get the Forums complete url instead of hard-coding it?
SH
Makador
10-23-2004, 11:46 AM
Very nice, I was searching for something like that.
KoalaMama
05-04-2006, 03:24 PM
Forgive me if this is a silly question - I'm new! But can I add this code at one of the vB hooks? And if so, which one should I be using? Thanks!
cocjh1
11-14-2006, 04:03 PM
Has anybody considered writing this as a plug-in for 3.6??
Note, I had to slightly modify the above code to work on 3.6...
$usergroupid = $vbulletin->input->clean_gpc('p', 'usergroupid', TYPE_UINT);
$leaders = $db->query_read("
SELECT ugl.userid, username, email
FROM " . TABLE_PREFIX . "usergroupleader AS ugl
INNER JOIN " . TABLE_PREFIX . "user AS user USING(userid)
WHERE ugl.usergroupid = $usergroupid
");
while ($leader = $db->fetch_array($leaders))
{
vbmail($leader["email"], "new forums usergroup join request",
"A Forums user has asked to join a usergroup that you lead.\nPlease handle it at http://www.domain.com/forums/profile.php?do=editusergroups", true);
}
itsalltropical
01-05-2007, 05:35 PM
Has anybody considered writing this as a plug-in for 3.6??
Note, I had to slightly modify the above code to work on 3.6...
[/php]
This code is exactly what I need. I have vBulletin 3.6.4 for a few weeks now. I am a novice so is there a way to put userid and usergroup in the text of the email? I see that ugl.userid and ugl.usergroupid are defined so how would I put that in the text of the email. Please include all <>, "", etc 'cause I am a novice.
I agree this should be a standard option in vBulletin, but I am so thankful as a newbie you guys offer these hacks! Thanks.
P.S. I have no idea why my text changed to green. I tried to change it back to blackhttps://vborg.vbsupport.ru/external/2010/01/19.gif
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.