Inform admin of new user registration

Is there a feature that you would like to see added to Enuuk Auction Platform?
Post Reply
bamse
Posts: 220
Joined: Mon Feb 06, 2012 12:05 pm
Contact:

Inform admin of new user registration

Post by bamse » Sat Mar 09, 2013 8:42 pm

If phpauction is set so that admin needs to confirm user registration, the user who registers gets informed of the status of his registration at each step (confirm email, admin approves account).

However admin does not get informed by email of new registrations, so does not really know whether there are new user registrations unless admin goes to the backend->Users management-> "Email verified but account not activated". I think it would help administration of the site if an email was sent to admin after a new user confirmed his email (by clicking on the confirmation link).

RWAP
Site Admin
Posts: 748
Joined: Fri Jan 08, 2010 2:23 am
Location: Stoke-on-Trent
Contact:

Re: Inform admin of new user registration

Post by RWAP » Sat Mar 09, 2013 9:10 pm

That should be quite easy to do - presumably this is only needed if the options are set to ensure the admin has to approve new registrations (never tried this myself)?

bamse
Posts: 220
Joined: Mon Feb 06, 2012 12:05 pm
Contact:

Re: Inform admin of new user registration

Post by bamse » Sun Mar 24, 2013 11:10 pm

In class/Action/User.php find

Code: Select all

if($this->context->siteOptions['signupApproval']){
                    $user->active = 0;
                    $user->saveToDB($this->db);
                    $data['msg'] = _("Thank you for confirming your registration! You can participate in site activities after admin validates your account.");
                }else{
replace with:

Code: Select all

 if($this->context->siteOptions['signupApproval']){
                    $user->active = 0;
                    $user->saveToDB($this->db);
                    $data['msg'] = _("Thank you for confirming your registration! You can participate in site activities after admin validates your account.");

                        require_once ('class/contrib/phpmailer/class.phpmailer.php');
                        $notificator = new MailNotificator(new PHPMailer(),new FileReader(),$this->context);
                        $par['sitename'] = $this->context->siteOptions['siteName'];

                        $par['id'] = $user->id;
                        $par['name'] = $user->name;
                        $par['address'] = strip_tags($user->address);
                        $par['city'] = $user->city;
                        $par['state'] = $user->state;
                        $par['country'] = Country::getInstanceFromDB($this->db,$user->countryId)->name;
                        $par['zip'] = $user->zip;
                        $par['phone'] = $user->phone;
                        $par['email'] = $user->email;

                        $par['adminMail'] = $this->context->siteOptions['adminMail'];
                        $fromMail = $this->context->siteOptions['fromMail'];
                        $fromMailName = $this->context->siteOptions['siteName'];

                        $mailStatus = $notificator->send($par['adminMail'],
                                $fromMail,$fromMailName,
                                MailNotificator::NEW_USER_REGISTRATION,
                                $user->userLanguage,
                                $par);

                }else{
and add the new e-mail message as follows

in class/MailNotificator.php

Code: Select all

 const NEW_USER_REGISTRATION = "new_user_registration";
and add a file ' new_user_registration.en_US.txt' in themes/mails with the following content (or something similar).

Code: Select all

New user registration
----
Dear Admin,<br />
<br />
Below user has registered and confirmed his email at <#sitename#>.<br />
Please validate registration.<br />

<br />
Username: <#id#><br />
Full name: <#name#><br />
Address: <#address#><br />
City: <#city#><br />
Province/Region: <#state#> <br />
Country: <#country#><br />
Zip Code: <#zip#><br />
Telephone: <#phone#><br />
E-mail: <#email#><br />
<br />
If you have received this message in error, please write to the site administrator at <#adminMail#>.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest