MyBB Community Forums

Full Version: Instant E-Mail notification for every reply
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello there,

I'm using MyBB for roughly half a year now and really enjoy it. I know PHP programming, so I usually find my way around. I'm on 1.6.9 right now.

For this problem, I simply can't find where to meddle with the code... What I'm trying to do is make "instant e-mail subscription" more like a mailing list.
For my community, passive information is a very regular way of using the forum (unfortunately). Thus, it'd be great if users would simply get the new replies via e-mail, regardless of their visit of the forum after the last time they got notified. Usually, you have to visit the forum once more to get informed about new replies. I want to change that.

I assume it's a simple hack where the subscription timestamp is updated in the DB, and I would have to uncomment the line or something, but I can't find the appropriate file. Any help?

On a sidenote, the absolutely preferred way would be a new subscription method in the dropdown-menu. Unfortunately, I don't know enough about MyBB-plugins to know where to define variables. If there's a plugin that does something similar, that'd be great! Otherwise, a hack for the mail notification will work just fine.

Many thanks!

Jan

Edit: Title was misleading, updated it.
notifying each new post to all members is not practical as it requires additional resources from web server.
instead encourage your forum members to subscribe to RSS feeds. you can also try using a feed server (eg. feedburner)

if you alone want to receive notification of new posts then you can use Admin Notice v1.3 plugin
Thank you for your reply. I agree that this requires additional resources. Of course, every use of a forum uses resources, and the important question is wether they are wisely used. In my case, the feature would make the forum way more useful. I consider this worthwhile. Also, we're talking about a userbase of about 20 people now.

The feed idea is nifty. I'd still prefer an "in-house" solution.
Probably you just need to modifiy this query in inc/datahandlers/post.php:
			// Fetch any users subscribed to this thread receiving instant notification and queue up their subscription notices
			$query = $db->query("
				SELECT u.username, u.email, u.uid, u.language, u.loginkey, u.salt, u.regdate, s.subscriptionkey
				FROM ".TABLE_PREFIX."threadsubscriptions s
				LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=s.uid)
				WHERE s.notification='1' AND s.tid='{$post['tid']}'
				AND s.uid != '{$post['uid']}'
				AND u.lastactive>'{$thread['lastpost']}'
			");
you can try using above referred plugin. it can send mails to multiple users. And I'd suggest to
post your requirement on that plugin's forum (its coder is one of the great contributors here)
hmm., I forgot about automatic subscriptions plugin. it should be working.
Stefan, thanks, that was exactly where I needed to look. Deleting the bit
AND u.lastactive>'{$thread['lastpost']}'
led to the desired behavior. Great!

.m., thanks for your help. The plugin seems to solve a different problem, though, or am I misunderstanding? Seems like this signs everyone up for supbscriptions, which is not what I was looking for. People should still be able to choose if they want e-mail subscriptions, but if they choose yes, they should get them regardless of wether they visit the forum in between.
Quote:People should still be able to choose if they want e-mail subscriptions, but if they choose yes,
they should get them regardless of wether they visit the forum in between
if I am not mistaken, automatic subscriptions plugin is exactly for above requirement.
its option is available while registering for the forum and also in user control panel
I see. Allright, I'll look into that if I want the extra option. The description sounded as if it only automatically signed people up, but then would send 1 mail once there's a new reply, and not for new replies after that. Thanks!