11
GPboarder
Re: How do I edit the mail to administrators notifying them of a new registration?
  • 2008/11/24 17:02

  • GPboarder

  • Friend of XOOPS

  • Posts: 248

  • Since: 2006/10/6


I took the plunge into the coding world and made these changes to /profile/register.php at line 194 in the original file.
Still no joy here.
I mixed the case to see if it mattered, but my notification to the administrators remains the same.

It sends notification mail just as before, with only the username and email inserted properly into the body of the mail.

The fields I am looking for are all in the first step of registration.


elseif ($xoopsConfigUser['activation_type'] == 2) {
                    
$xoopsMailer xoops_getMailer();
                    
$xoopsMailer->useMail();
                    
$xoopsMailer->setTemplate('adminactivate.tpl');
                    
$xoopsMailer->assign('USERNAME'$newuser->getVar('uname'));
                    
$xoopsMailer->assign('USEREMAIL'$newuser->getVar('email'));
                    
$xoopsMailer->assign('DISPLAYNAME'$newuser->getVar('displayname'));
                    
$xoopsMailer->assign('email2'$newuser->getVar('email2'));
                    
$xoopsMailer->assign('MUNICIPALITY'$newuser->getVar('municipality'));
                    
$xoopsMailer->assign('street_address'$newuser->getVar('street_address'));
                    
$xoopsMailer->assign('RELATIONSHIP'$newuser->getVar('relationship'));
                    
$xoopsMailer->assign('USERACTLINK'XOOPS_URL "/modules/" $xoopsModule->getVar('dirname''n') . '/activate.php?id=' $newuser->getVar('uid') . '&actkey=' $newuser->getVar('actkey''n'));
                    
$xoopsMailer->assign('SITENAME'$xoopsConfig['sitename']);
                    
$xoopsMailer->assign('ADMINMAIL'$xoopsConfig['adminmail']);
                    
$xoopsMailer->assign('SITEURL'XOOPS_URL "/");
                    
$xoopsMailer->setToGroups($member_handler->getGroup($xoopsConfigUser['activation_group']));
                    
$xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
                    
$xoopsMailer->setFromName($xoopsConfig['sitename']);
                    
$xoopsMailer->setSubject(sprintf(_US_USERKEYFOR$newuser->getVar('uname')));
                    if ( !
$xoopsMailer->send() ) { {


Optimism is the mother of disappointment.

12
ghia
Re: How do I edit the mail to administrators notifying them of a new registration?
  • 2008/11/24 23:59

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


The names in the first parameter have to correspond exactly with the field in the mail, the other with the user profile field.
It is possible that you are not using the correct activation type or modifying at the wrong place.
If you change:
$xoopsMailer->assign('USERNAME'$newuser->getVar('uname'));
to
$xoopsMailer->assign('USERNAME'$newuser->getVar('uname').'test');

Is test then appended to the username (which I assume appears correct) in the mail?
If not try the other activation types.
The numbers correspond to direct activation, activation by email or administrator activation (didn't check which numbers are what.)
You can also use a fix text temporary as test for some fields.

13
GPboarder
Re: How do I edit the mail to administrators notifying them of a new registration?
  • 2008/11/25 4:34

  • GPboarder

  • Friend of XOOPS

  • Posts: 248

  • Since: 2006/10/6


Thank you!

The activation by administration is type 2. I was making changes in the right place, so that gave me some encouragement to continue.

I am however stumped with some things working and some not. I have looked at it far too long now and need a break. I can't detect the errors that are causing some of the information to appear and some not.

The mail to administrators now reads as follows with the bold being drawn from the new user's profile.

A new user testuser49test (test1@mysite.ca) has just registered an account at My Site.
The new user testuser49test entered the following information:
Real Name: GPboarder
Extra Info: I have nothing to add.
Birthday: {BIRTHDATE}
Second e-mail: {email2}
Relationship: {RELATIONSHIP}
The new user testuser49test (test1@mysite.ca) is thrilled that some of this is finally working.
Birthday: {BIRTHDATE}
Address: {STREETADDRESS}, {MUNICIPALITY}, Ontario {POSTALCODE}
The new user says that his/her current occupation is: Jack of All Trades

Followed by link to activate.

I'm going to test more after some rest and see if I can narrow the problem somehow.

My plan is to compare once more the spelling and case of the user profile field, register.php, and adminactivate.tpl, then to see if the fields that are not working share something in common.

Suggestions on how to proceed are welcome as this sort of thing is new to me.
Optimism is the mother of disappointment.

Login

Who's Online

456 user(s) are online (359 user(s) are browsing Support Forums)


Members: 0


Guests: 456


more...

Donat-O-Meter

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

Latest GitHub Commits