6
hi Mithrandir,
Thanks for the guidance. Got this thing up.
Anyone who want to send a welcome mail after the user clicks on activation link follow this steps.
1. Create a mail_template (language/english/mail_template/welcome.tpl)
Quote:
Hello {X_UNAME},
Welcome to {SITENAME} Your account has been activated.
You can now login from the following URL with the password you have provided upon registration.
{SITEURL}user.php
Other details Blah blah....
-----------
{SITENAME} ({SITEURL})
webmaster
{ADMINMAIL}
2. Modify the user.php at line no 125 add following lines just above redirect_header('user.php',5,_US_ACTLOGIN);
Quote:
$myts =& MyTextSanitizer::getInstance();
$xoopsMailer =& getMailer();
$xoopsMailer->useMail();
$xoopsMailer->setTemplate('welcome.tpl');
$xoopsMailer->assign('SITENAME', $xoopsConfig['sitename']);
$xoopsMailer->assign('ADMINMAIL', $xoopsConfig['adminmail']);
$xoopsMailer->assign('SITEURL', XOOPS_URL."/");
$xoopsMailer->setToUsers($thisuser);
$xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
$xoopsMailer->setFromName($xoopsConfig['sitename']);
$xoopsMailer->setSubject(sprintf(_US_YOURACCOUNT,$xoopsConfig['sitename']));
include 'header.php';
if ( !$xoopsMailer->send() ) {
printf(_US_WELCOMEMAILFAIL, $thisuser->getVar('uname'));
} else {
printf(_US_WELCOMEMAILOK, $thisuser->getVar('uname'));
}
include 'footer.php';
3. Now add the defination for two variables used above in
language/english/user.php
Quote:
define('_US_WELCOMEMAILFAIL', 'Failed sending Welcome Kit email to %s. Contact the Administrator');
define('_US_WELCOMEMAILOK', 'A Welcome Kit has been emailed to %s. Please read it before procceding. Your account has been activated. Please login with the registered password. ');
And thats done :)
Now whenever user registers and clicks on the activation link. He will recieve a welcome mail :)
This one works for me.. i am no srcipting guru.. so if there is something thats needed to modify please feel free to guide me. i will correct it.
Vinit