2008-08-21, 03:01 AM
Dear all,
I found a (old) plugin of Schnibble and want to modify that for ver 1.4.
But one way or the other I don't get it to work,
The hook that I am using is....
$plugins->add_hook("member_activate_accountactivated", "mailoa_start");
function mailoa_start() {
global $db, $mybb, $settings, $cache;
$query = $db->query("SELECT username, email FROM ".TABLE_PREFIX."users WHERE uid='".intval($mybb->input['uid'])."'");
$user = $db->fetch_array($query);
if ($user['email'] != '') {
$search = array('{user}','{site}','{url}');
$replace = array($user['username'], $settings['bbname'], $settings['bburl']);
$subject = str_replace($search, $replace, $settings['mailoa_subject']);
$message = str_replace($search, $replace, $settings['mailoa_body']);
my_mail($user['email'], $subject, $message);
}
}
But since the mail never arrives I think the mailoa_start funcyion is never fired.
I have checked and I can receiv mail via MyBB (tested with Mass mail feature) And the user has an email address.
Thanks for the support.
I found a (old) plugin of Schnibble and want to modify that for ver 1.4.
But one way or the other I don't get it to work,
The hook that I am using is....
$plugins->add_hook("member_activate_accountactivated", "mailoa_start");
function mailoa_start() {
global $db, $mybb, $settings, $cache;
$query = $db->query("SELECT username, email FROM ".TABLE_PREFIX."users WHERE uid='".intval($mybb->input['uid'])."'");
$user = $db->fetch_array($query);
if ($user['email'] != '') {
$search = array('{user}','{site}','{url}');
$replace = array($user['username'], $settings['bbname'], $settings['bburl']);
$subject = str_replace($search, $replace, $settings['mailoa_subject']);
$message = str_replace($search, $replace, $settings['mailoa_body']);
my_mail($user['email'], $subject, $message);
}
}
But since the mail never arrives I think the mailoa_start funcyion is never fired.
I have checked and I can receiv mail via MyBB (tested with Mass mail feature) And the user has an email address.
Thanks for the support.