1
barryc
Adding to notification email
  • 2011/6/2 15:46

  • barryc

  • Just can't stay away

  • Posts: 480

  • Since: 2004/3/20


I would like to add to the notification email that the admin gets when someone new registers on our site. Specifically, I would like to add the City and State of the registrant so that we can invite the person to meetings of our regional clubs.

I have set things up such that city and state are required fields on registration form. They are stored in the tables for the profile module.

I know which message would have to be edited. Is there some way I can insert codes into the notification message such that the city and state are automatically entered? That would save us having to look up the registrant's information.

barryC

2
jlm69
Re: Adding to notification email
  • 2011/6/4 21:28

  • jlm69

  • Module Developer

  • Posts: 719

  • Since: 2002/7/19


I see no one has takin a chance with this one.

Well here it goes.
This would be for 2.5.x


in profile/register.php around line 152 look for this line:

if ($current_step == 1) {

after it add this line, and any other you want(replace state with other field name):

$state = isset($_POST['state']) ? $myts->stripSlashesGPC(trim($_POST['state']) ) : '';


then go down to about line 169 or so and find this line:

$newuser->setVar('uname', $uname);

before it add this line:

$profile->setVar('state', $state);


then go down to around line 190 or so and find this line:

$uname = isset($_POST['uname']) ? $myts->stripSlashesGPC(trim($_POST['uname'])) : '';

before it add this line:

$state = isset($_POST['state']) ? $myts->stripSlashesGPC(trim($_POST['state'])) : '';


then go down a few lines and find this line:

$newuser->setVar('uname', $uname);

before it add this line:

$profile->setVar('state', $state);

then go down to about line 257 or so and find this line:

$xoopsMailer->setTemplate('adminactivate.tpl');

after it add this line:

$xoopsMailer->assign('STATE', $profile->getVar('state'));


save that page.

Now go to the adminactivate.tpl and add:

{STATE}

where you want.

And that should do it.

Hope this helps.

John



Login

Who's Online

171 user(s) are online (115 user(s) are browsing Support Forums)


Members: 0


Guests: 171


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