1
vinit
How to send a Welcome mail on User Activation
  • 2004/7/8 16:23

  • vinit

  • Just can't stay away

  • Posts: 530

  • Since: 2004/1/10


Hi,

How to send a customised welcome mail to user once he clicks on activation link or activates his account after registration.

As of now only activation link mail is sent. And if the registration passes by the verifaction process then only a welcome mail /Account activate mail is send. What i want is as soon as user activates his account he should recieve a weclome mail giving introduction about the site.

How to do this?

Vinit

2
vinit
Re: How to send a Welcome mail on User Activation
  • 2004/7/10 8:16

  • vinit

  • Just can't stay away

  • Posts: 530

  • Since: 2004/1/10


look like there is nothing by default in this relate. Is there some hacks which does this. Otherwise some tweaks had to be made.

3
Anonymous
Re: How to send a Welcome mail on User Activation
  • 2004/7/10 8:20

  • Anonymous

  • Posts: 0

  • Since:


I do not think there is one. Would be nice. What I did for a month or so, when a new user signed up, I sent a copy n paste message to their inbox.....got tired of doing that. so A defaulted customized message would be nice!

4
vinit
Re: How to send a Welcome mail on User Activation
  • 2004/7/10 11:37

  • vinit

  • Just can't stay away

  • Posts: 530

  • Since: 2004/1/10


I think this is not a tough call, since XOOPS already allows sending of activation mail, so just need to add one more function in php file which activates user. this fuction will send the customised mail. i think i will find out some fix given that i get some time :p

5
Mithrandir
Re: How to send a Welcome mail on User Activation

Yep.

kernel/member.php line 408 : MembershipHandler::activateUser()

Can check the approach used for sending the activation email in register.php 'finish' case starting on line 169

6
vinit
Re: How to send a Welcome mail on User Activation
  • 2004/8/6 15:34

  • vinit

  • Just can't stay away

  • Posts: 530

  • Since: 2004/1/10


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


Login

Who's Online

446 user(s) are online (70 user(s) are browsing Support Forums)


Members: 0


Guests: 446


more...

Donat-O-Meter

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

Latest GitHub Commits