MyBB Community Forums

Full Version: When/where does the mail function get called?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi there,

I want to make adjustments to the mailing options (subscribe to thread mainly) and I can't seem to find where and when the actual call takes place that sends the mail from the queue.

My feeling says it's somewhere like when a user posts a new message (it checks for subscriptions and updates the queue, but nothing more), or is it a timed process?

Any help on this would be appreciated!

Edit: let me clarify this.
I found where the mail function gets called, but I can't find a reference to where the information gets stored that makes a user stop receiving emails after one mailing. I need to remove that limit somehow.

Cheers,
Reinier
Not sure what you mean.
Subscription mails get generated in the post datahandler, then later processed by the mail queue.
So basically you want users to get 30 emails if suddenly a thread gets 30 replies? I doubt spam filters like that.
Nevermind: I have found it.
Still not sure what process actually sends the e-mail (e.g. empties the mailqueue and sends the mails), but at least I know how to give users an option for multiple e-mails.
Check send_mail_queue in inc/functions.php
That function has 0 references, so it means it never gets called anywhere in the code.
The piece of code I was looking for is in the post data handler. Although the code in general has pretty decent commenting, it seems to be missing in the really important parts ;-)
(2011-11-03, 11:39 AM)ReinierK Wrote: [ -> ]That function has 0 references, so it means it never gets called anywhere in the code.
Cause dead code is great right?

From inc/init.php
// Set up any shutdown functions we need to run globally
add_shutdown('send_mail_queue');