How can I automatically send a welcome PM (Private Message) to my new members?

Requested and Answered by Bluenova on 2005/11/16 10:13:06

How can I automatically send a welcome PM (Private Message) to my new members?

Xoops 2.0.X Open /**Xoopsinstallation**/register.php

Find:

(XOOPS_GROUP_USERS, $newid)) { echo _US_REGISTERNG; include 'footer.php'; exit(); }


Xoops 2.2.X Open /**Xoopsinstallation**/modules/profile/register.php

Find:
 $newid = $newuser->getVar('uid'); if (!$member_handler->addUserToGroup(XOOPS_GROUP_USERS, $newid)) { echo _PROFILE_MA_REGISTERNG; break; }


Add After:
//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

This Q&A was found on XOOPS Web Application System : https://xoops.org/modules/smartfaq/faq.php?faqid=532