3
OK, I've got it working. An email is now sent to whoever is PM'd to get them to come back to the site.
I created a mail template like this...
le="color: #000000"><?php Hello {RNAME}, {SNAME} has sent you a PM. Log in to {SITENAME} ({SITEURL}) to read the message. -------------------------------------------------------------------------------- {SITENAME} ({SITEURL})
added the following line below 'include "mainfile.php";' in pmlite.php
le="color: #000000"><?php include "class/xoopsmailer.php";
and the following below ' echo "<br /><a href='javascript:history.go(-1)'>"._PM_GOBACK."</a>";
} else {'
(around line 70)
le="color: #000000"><?php $xoopsMailer =& getMailer(); $xoopsMailer->useMail(); $xoopsMailer->setTemplateDir(XOOPS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/mail_template'); $xoopsMailer->setTemplate("yougotmail.tpl"); $toUserID = $HTTP_POST_VARS['to_userid']; $sql = mysql_query("SELECT email,uname FROM ".$xoopsDB->prefix("users")." WHERE uid = $toUserID"); $toUserEmail = mysql_result($sql, 0, 'email'); $toUserName = mysql_result($sql, 0, 'uname'); $xoopsMailer->setToEmails($toUserEmail); $xoopsMailer->setFromEmail($xoopsConfig['adminmail']); $xoopsMailer->setFromName($xoopsConfig['sitename']); $subject = 'You've got mail!!'; $xoopsMailer->setSubject($subject); $sname = $xoopsUser->getVar("uname"); $xoopsMailer->assign("RNAME", $toUserName); $xoopsMailer->assign("SNAME", $sname); $xoopsMailer->assign("SITENAME", $xoopsConfig['sitename']); $xoopsMailer->assign("SITEURL", XOOPS_URL."/"); $xoopsMailer->send();
All seems to work great. Feel free to point out errors or pitfalls in my implementation
Thanks,
xgarb