MyBB Community Forums

Full Version: Mail on Activation Email Plug-in not Working
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
There seem to be a number of posts about this plug-in in both the general and plug-in forums, so I took a chance and put it here. Please move it if necessary. Sorry.

I am having issues with this plug-in. I receive PHP mail from the system and receive SMTP mail from the system, but =not= with this plug-in.

Looks like this line

$db->insert_query("maillogs", $log_entry);

from the mailoa_start() function is supposed to insert a row into the maillogs table, but when I check the table, there isn't one there. I've deactivate and activated the function with no luck. I get the same behavior from this plug-in whether I've configured the system for SMTP or PHP - and I receive both types with no issues normally.

Any ideas anyone?
I found the answer. Seems the hook wasn't there in the delivered code.

I found this in the Reviews for the plug-in:

Quote:Works like a charm. And it even does so with email based self-activation, if you add a line like

Code:

$plugins->add_hook("member_activate_accountactivated", "mailoa_start");

After adding this hook, it works fine and I've validated that the emails are being inserted into the table.

Thanks to ZAKKINEN for posting the additional hook. I've posted it here so if anyone else has this problem, it will come up in a search.
Buddy it would be better if you can eloborate this a bit more bro so it will help others also on how to use this thing called "Hook"

i mean where to use this php code pls post a bit more and if possible in detail.

thnx in advance
I'm new to MyBB, too, but if you want to learn about hooks, my best recommendation is to start opening up the core php files and look for things like

$plugins->run_hooks("member_do_register_start");

That is a placemarker in the code that enables you to "insert my code here" by way of plugins by placing a complementary call in your plugin such as:

$plugins->add_hook("member_do_register_start", "my_procedure");

When the core php file is executed, your plugin code will be executed (specifically your procedure called "my_procedure") when it reaches the place where it calls anything hooked into "member_do_register_start".

I'm sure there's lot of information on hooks on the forum.

Here's a list:
http://wiki.mybboard.net/index.php/MyBB_Plugin_Hooks
But bro how to use this code which you have mentioned in code tag.....

pls tell me where it is so i can change that thing...
Open up mailoa.php and at line 20, right after

$plugins->add_hook("admin_user_users_coppa_activate_commit", "mailoa_start");

replace the line that's there with:

$plugins->add_hook("member_activate_accountactivated", "mailoa_start");

I don't know what the hook was that was there originally because I already changed it.
dude you r talking bout which version ??
i am using 1.40 and if u r talking bout any particular plugin i cant see that
Yes, I'm talking 1.4. You need to download the plugin first before you can edit it. You can find it in the download section.