PDA

View Full Version : New Post Notification


LNF
01-16-2011, 09:26 PM
I would like to notify certain usergroups via email when a new post is made in certain forums.

From what I see, I can type in individual email addresses followed by spaces in the admincp>forum manager>edit forum>Email Addresses to Notify When there is a New Post. This isn't favourable as members can change user groups and I would have to manually revise the list. Not to mention adding new users...

Is there a hack that would allow me to just type in the user group in the email address to notify in admin cp?

MoMan
01-16-2011, 10:23 PM
I don't think there's a hack out for this, but it sounds pretty easy to code up if you have a comma-separated field in the forum editor. Here's some pseudo-code that you can put wherever the current e-mailing calls are made:

$usergroups = '(' . $usergroup_field . ')'; // you probably want to validate input for your actual implementation
$emails = $vbulletin->db->query_read("SELECT email FROM _vbuser WHERE usergroupid IN $usergroups");

while($result = $vbulletin->db->fetch_row($emails))
{
vbmail($result['email'],$title, $message);
}

Videx
01-17-2011, 06:46 PM
There's a mod that allows instant notification for forum subscriptions. But users have to subscribe to the forum themselves. And last I looked it had no options at all such as excluding forums or usergroups.

Note that subscribing people involuntarily like you're planning could quickly get you blacklisted.

LNF
01-17-2011, 06:59 PM
thanks for the input...

Is there a way I can modify the text in the notification message?

Videx
01-17-2011, 08:18 PM
Yes, virtually all text in vb is in AdminCP>Phrases.