Send a welcome PM to a user when they register on a
site. I currently use this on most of my sites with a
hack, but it would be good to include it in the core
and use the database to store the text, which can be
edited from the admin side. The code I use is as
follows:
register.php
Find:
code) {
echo _US_REGISTERNG;
include 'footer.php'; exit();
}[/code]
Add after:
[code]//Welcome PM Hack start
//Yeah,already defined above^^
// $newid = $newuser->getVar('uid');
$pm_handler =& xoops_gethandler('privmessage');
$pm =& $pm_handler->create();
$pm->setVar("subject", "Add the subject here");
$pm->setVar("msg_text", "Add your message text
here!!!!!!!");
//Newuser's id$pm->setVar("to_userid", $newid);
// Admin's id,1 in my case$pm->setVar("from_userid",
1);
if (!$pm_handler->insert($pm)) {
// echo "Failed to send Welcome Private Message!!";
// No need to echo this failure-message here,I think
so!!...Just optional^^}
//Welcome PM Hack end[/code]