![schneider](https://xoops.org/uploads/avatars/cavt6010580963770.jpg)
I'm very new to xoops, I don't know how to get to the database table to do the "isactive" modification of the protector from 1 to 0.
// @todo: Send notification email if user has selected this in the profile
// Added by BigKev73 to enabled email on new PM
$sUser = $member_handler->getUser(XoopsRequest::getInt('to_userid', 0, 'POST'));
$rez= $pm_handler->sendPMEmail($pm, $sUser);
//added by BigKev73 to renable sending a email when a new PM is created
public function sendPMEmail(PmMessage $pm, XoopsUser $user)
{
global $xoopsConfig;
if (is_object($user)) {
$from = new XoopsUser($pm->getVar('from_userid'));
$to = new XoopsUser($pm->getVar('to_userid'));
$msg = 'You received a new Private Message from ' . $from->getVar('name');
$msg .= "nn";
$msg .= "Sent: " . formatTimestamp($pm->getVar('msg_time'));
$msg .= "n";
$msg .= "n Subject: " . $pm->getVar('subject') . "n";
$msg .= "n Message: " . strip_tags(str_replace(array(''
, '', '
', '
'), "n", $pm->getVar('msg_text'))) . "nn";
$msg .= "--------------n";
$msg .= $xoopsConfig['sitename'] . ': ' . XOOPS_URL . "n";
$xoopsMailer = xoops_getMailer();
$xoopsMailer->useMail();
$xoopsMailer->setToEmails($user->getVar('email'));
$xoopsMailer->setFromEmail($xoopsConfig['from']);
$xoopsMailer->setFromName($xoopsConfig['fromname']);
$xoopsMailer->setSubject(sprintf("You received a Private Message on " . $xoopsConfig['sitename']));
$xoopsMailer->setBody($msg);
return $xoopsMailer->send();
}else {
return null;
}
}
$msg = 'You received a new Private Message from ' . $from->getVar('name');
$msg = 'You received a new Private Message from ' . $from->getVar('uname'); if you want the default.
$xoopsMailer->setFromEmail($xoopsConfig['from']);
$xoopsMailer->setFromName($xoopsConfig['fromname']);
$xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
$xoopsMailer->setFromName($xoopsConfig['sitename']);
{X_NAME} will print name or uname if empty