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...
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
include "class/xoopsmailer.php";
and the following below ' echo "
"._PM_GOBACK."";
} else {'
(around line 70)
$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