1
kbkhoo5053
Searching For Auto - Generated Email Php Coding
  • 2005/1/24 0:54

  • kbkhoo5053

  • Just popping in

  • Posts: 19

  • Since: 2005/1/13


I am looking for auto generated email Php coding for my websites. How to obtain the coding for it. When user register my websites then they will receive alert message regarding what they need to do such as activate their account before they can sign in to my websites.

2
Draven
Re: Searching For Auto - Generated Email Php Coding
  • 2005/1/24 3:53

  • Draven

  • Module Developer

  • Posts: 337

  • Since: 2003/5/28


That e-mail is generated by a setting found in the root XOOPS folder under languages/mail_templates/register.tpl

3
kbkhoo5053
Re: Searching For Auto - Generated Email Php Coding
  • 2005/1/24 7:58

  • kbkhoo5053

  • Just popping in

  • Posts: 19

  • Since: 2005/1/13


Draven,

Thx for ur infor. Indeed, may I know where can I obtain the full PHP Coding for Auto Generated Email? I need to apply it in my websites. Can you help me by providing me some guidelines. Thanks.

4
Draven
Re: Searching For Auto - Generated Email Php Coding
  • 2005/1/24 17:37

  • Draven

  • Module Developer

  • Posts: 337

  • Since: 2003/5/28


Sorry I misunderstood the question.

The main class used for mailing is xoopsmailer.php located in the class folder of the main install directory.

To see how the class works you can review the register.php which handles sending out the welcome message.


Here are the lines that are important for mailing, extracted from register.php
if ($xoopsConfigUser['activation_type'] == 0) {
            
$myts =& MyTextSanitizer::getInstance();
            
$xoopsMailer =& getMailer();
            
$xoopsMailer->useMail();
            
$xoopsMailer->setTemplate('register.tpl');
            
$xoopsMailer->assign('SITENAME'$xoopsConfig['sitename']);
            
$xoopsMailer->assign('ADMINMAIL'$xoopsConfig['adminmail']);
            
$xoopsMailer->assign('SITEURL'XOOPS_URL."/");
            
$xoopsMailer->setToUsers(new XoopsUser($newid));
            
$xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
            
$xoopsMailer->setFromName($xoopsConfig['sitename']);
            
$xoopsMailer->setSubject(sprintf(_US_USERKEYFOR,$myts->oopsStripSlashesGPC($uname)));
//            OpenTable();
            
if ( !$xoopsMailer->send() ) {
                echo 
_US_YOURREGMAILNG;
            } else {
                echo 
_US_YOURREGISTERED;
            }
//            CloseTable();
        
} elseif ($xoopsConfigUser['activation_type'] == 2) {
            
$myts =& MyTextSanitizer::getInstance();
            
$xoopsMailer =& getMailer();
            
$xoopsMailer->useMail();
            
$xoopsMailer->setTemplate('adminactivate.tpl');
            
$xoopsMailer->assign('USERNAME'$myts->oopsStripSlashesGPC($uname));
            
$xoopsMailer->assign('USEREMAIL'$myts->oopsStripSlashesGPC($email));
            
$xoopsMailer->assign('USERACTLINK'XOOPS_URL.'/user.php?op=actv&id='.$newid.'&actkey='.$actkey);
            
$xoopsMailer->assign('SITENAME'$xoopsConfig['sitename']);
            
$xoopsMailer->assign('ADMINMAIL'$xoopsConfig['adminmail']);
            
$xoopsMailer->assign('SITEURL'XOOPS_URL."/");
            
$member_handler =& xoops_gethandler('member');
            
$xoopsMailer->setToGroups($member_handler->getGroup($xoopsConfigUser['activation_group']));
            
$xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
            
$xoopsMailer->setFromName($xoopsConfig['sitename']);
            
$xoopsMailer->setSubject(sprintf(_US_USERKEYFOR,$myts->oopsStripSlashesGPC($uname)));
//            OpenTable();
            
if ( !$xoopsMailer->send() ) {
                echo 
_US_YOURREGMAILNG;
            } else {
                echo 
_US_YOURREGISTERED2;
            }
//            CloseTable();
        
}
        if (
$xoopsConfigUser['new_user_notify'] == && !empty($xoopsConfigUser['new_user_notify_group'])) {
            
$myts =& MyTextSanitizer::getInstance();
            
$xoopsMailer =& getMailer();
            
$xoopsMailer->useMail();
            
$member_handler =& xoops_gethandler('member');
            
$xoopsMailer->setToGroups($member_handler->getGroup($xoopsConfigUser['new_user_notify_group']));
            
$xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
            
$xoopsMailer->setFromName($xoopsConfig['sitename']);
            
$xoopsMailer->setSubject(sprintf(_US_NEWUSERREGAT,$xoopsConfig['sitename']));
            
$xoopsMailer->setBody(sprintf(_US_HASJUSTREG,$myts->oopsStripSlashesGPC($uname)));
            
$xoopsMailer->send();
        }

Login

Who's Online

197 user(s) are online (111 user(s) are browsing Support Forums)


Members: 0


Guests: 197


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits