Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Unactivated members & Email Notification

Asked Modified Viewed 4,066 times
S
sativa1984
S
  • Junior Member, joined since
  • Contributed 17 posts on the community forums.
  • Started 8 threads in the forums
  • Started this discussions
asked
Junior Member

Hello,

I have been looking for a way to get my website to email me when a new member requires activating after registering (site is setup to admin activation)

I have searched about and found a snippet of code to add to register.php but it did not work, the code was:

//-----UNACTIVATED USERS EMAIL NOTIFICATION-----//
require_once INCLUDES."sendmail_include.php";
$toname= "".$settings['siteemail']."";
$toemail = "".$settings['siteemail']."";
$fromemail = "".$settings['siteemail']."";
$site = "".$settings['sitename']." - ".$settings['siteurl']."";
$subject = "New member notification!";
$content = "There is a new member on your site which need to be activated. Click on the link to go to your website. ".$site." ";

sendemail($toname,$toemail,$fromemail,$site,$subject,$content);
//-----UNACTIVATED USERS EMAIL NOTIFICATION-----//


I would of thought this option would be somewhere in the admin page but i can not find anything.

Please help.
Thanks.
0 replies

7 posts

M
MeTRoiD
M
  • Member, joined since
  • Contributed 114 posts on the community forums.
  • Started 11 threads in the forums
answered
Member

includes/classes/UserFieldsInput.class.php
Here the email to user is sent, you can add that if sents something to you too :)
Find sendemail functions and add another one for you..
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
answered
Fusioneer

Hi there,

I thought of that but it would be better if it does not send the admin an email until the user has clicked the activate link in the registration verify email.

Kind Regards
Craig
0 replies
M
MeTRoiD
M
  • Member, joined since
  • Contributed 114 posts on the community forums.
  • Started 11 threads in the forums
answered
Member

So i think you can do this this way:
$locale['u162'] = "An administrator will activate your account shortly.";

When this msq is shown to user, it will send YOU email..

On UserFieldsInput.class.php line 604
if ($this->adminActivation) {
$this->_completeMessage = $locale['u160']."<br /><br />\n".$locale['u162']; // msq is shown to user
// send email to your self
// add your code here..
}
Edited by MeTRoiD on 24-02-2013 18:09,
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
answered
Fusioneer

Hi,

I think it's more in the direction of down that file to around line 587...

$result = dbquery(
            "INSERT INTO ".DB_NEW_USERS." (
               user_code, user_name, user_email, user_datestamp, user_info
            ) VALUES(
               '".$userCode."', '".$this->_userName."', '".$this->_userEmail."', '".time()."', '".$userInfo."'
            )"
         );


Around that area is where to concentrate.

Or down more around line 600...

private function _setUserDataInput() {


Good Luck
Kind Regards
Craig
0 replies
S
sativa1984
S
  • Junior Member, joined since
  • Contributed 17 posts on the community forums.
  • Started 8 threads in the forums
  • Started this discussions
answered
Junior Member

Sorry guys i am not too clued up when it comes to coding php.

I usually just copy paste and edit where needed, i have found the locations you guys have suggested that i look but i am stuck on what to do next.

Any further help would be greatly appreciated.

Thanks.

Merged on Feb 26 2013 at 11:44:31:
I added this after line 600 but still nothing arriving at my inbox, any ideas?

   private function _setUserDataInput() {
      global $locale, $settings, $userdata, $aidlink;

      $result = dbquery("INSERT INTO ".DB_USERS." (".$this->_dbFields.") VALUES(".$this->_dbValues.")");
      if ($this->adminActivation) {
         $this->_completeMessage = $locale['u160']."<br /><br />\n".$locale['u162'];
         
      require_once INCLUDES."sendmail_include.php";
     $toname= "".$settings['siteemail']."";
     $toemail = "".$settings['siteemail']."";
     $fromemail = "".$settings['siteemail']."";
     $site = "".$settings['sitename']." - ".$settings['siteurl']."";
     $subject = "New member notification!";
     $content = "There is a new member on your site which need to be activated. Click on the link to go to your website. ".$site." ";

     sendemail($toname,$toemail,$fromemail,$site,$subject,$content);
         
      }
Edited by sativa1984 on 26-02-2013 14:07,
0 replies
M
MeTRoiD
M
  • Member, joined since
  • Contributed 114 posts on the community forums.
  • Started 11 threads in the forums
answered
Member

Go to - admin panel -> settings -> Miscellaneous
Check these fields:

SMTP Host
SMTP Port
SMTP Authentication? (Check or uncheck)
SMTP Username
SMTP Password
0 replies
S
sativa1984
S
  • Junior Member, joined since
  • Contributed 17 posts on the community forums.
  • Started 8 threads in the forums
  • Started this discussions
answered
Junior Member

Managed to fix this with help from another site.

If anybody else wants to know how to make this work, simply copy this code onto line 52 of your register.php

            //-----UNACTIVATED USERS EMAIL NOTIFICATION-----//
      require_once INCLUDES."sendmail_include.php";
      $toname= "".$settings['siteusername']."";
      $toemail = "".$settings['siteemail']."";
      $fromemail = "".$settings['siteemail']."";
      $site = "".$settings['sitename']." - ".$settings['siteurl']."";
      $subject = "New Member Notification";
      $content = "There is a new member on your site which need to be activated. Click on the link to go to your website: ".$site." \n";
      sendemail($toname,$toemail,$site,$fromemail,$subject,$content);
      //-----UNACTIVATED USERS EMAIL NOTIFICATION-----//
Edited by sativa1984 on 01-03-2013 12:20,
0 replies

Category Forum

User Administration - 8

Labels

None yet

Statistics

  • Views 0 views
  • Posts 7 posts
  • Votes 0 votes
  • Topic users 3 members

3 participants

C
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
M
M
  • Member, joined since
  • Contributed 114 posts on the community forums.
  • Started 11 threads in the forums
S
S
  • Junior Member, joined since
  • Contributed 17 posts on the community forums.
  • Started 8 threads in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet