Results 1 to 12 of 12

Thread: [Release] Email Activate Code

  1. #1
    Former Lead Developer, vBulletin Kier is a jewel in the rough Kier is a jewel in the rough Kier is a jewel in the rough Kier is a jewel in the rough Kier's Avatar
    Join Date
    Sep 2000
    Location
    Reading, UK
    Posts
    8,228
    Blog Entries
    6

    [Release] Email Activate Code

    This tiny hack is in response to a request from Sharg - I would put it into the 2.0 code, but understandably, John doesn't want to make any further modifications to the code unless they are absolutely necessary.

    It allows you to use the admin email function to send an email which will remind users in the 'Users awaiting bla bla bla' group of the link for their activation code.

    In admin/email.php, find this code:
    Code:
      $users=$DB_site->query("SELECT userid,username,password,email FROM user WHERE $condition AND userid>='$startat' AND userid<'$finishat' AND adminemail=1 ORDER BY userid DESC");
      while ($user=$DB_site->fetch_array($users)) {
    
        $userid=$user[userid];
        $sendmessage=$message;
        $sendmessage=str_replace("\$email",$user[email],$sendmessage);
        $sendmessage=str_replace("\$username",$user[username],$sendmessage);
        $sendmessage=str_replace("\$password",$user[password],$sendmessage);
    
        mail($user[email],$subject,$sendmessage,"From: $from");
    and replace it with this:
    Code:
      $users=$DB_site->query("SELECT userid,username,password,email,joindate FROM user WHERE $condition AND userid>='$startat' AND userid<'$finishat' AND adminemail=1 ORDER BY userid DESC");
      while ($user=$DB_site->fetch_array($users)) {
    
        $userid=$user[userid];
        $sendmessage=$message;
        $sendmessage=str_replace("\$email",$user[email],$sendmessage);
        $sendmessage=str_replace("\$username",$user[username],$sendmessage);
        $sendmessage=str_replace("\$password",$user[password],$sendmessage);
        
    	$sendmessage=str_replace("\$userid",$user[userid],$sendmessage);
    	$sendmessage=str_replace("\$activateid",$user[joindate],$sendmessage);
    	$sendmessage=str_replace("\$bburl",$bburl,$sendmessage);
    	
    
        mail($user[email],$subject,$sendmessage,"From: $from");
    The variables $userid and $activateid are now available for you in the mail message, allowing you to construct the link to the activation page like this:

    $bburl/register.php?a=act&u=$userid&i=$activateid
    Meh. | Twitter: @KierDarby | Web: KierDarby.com
     

  2. #2
    Senior Member Sharg is on a distinguished road
    Join Date
    Jun 2000
    Posts
    1,606
    Yeeepiiiii !!!!
    Thanks Kier !! Thanks alot !
    I got 200 users in the user waiting group i'll send them the activation code now so i'm sure I will have more increased real subscribtion than ever before !!

    (So much easier for them just to click on a link to activate their account on a reminder Email) .

    Well, I hope this is going to make it in the official next release.
    Sharg.
     

  3. #3
    Former Lead Developer, vBulletin Kier is a jewel in the rough Kier is a jewel in the rough Kier is a jewel in the rough Kier is a jewel in the rough Kier's Avatar
    Join Date
    Sep 2000
    Location
    Reading, UK
    Posts
    8,228
    Blog Entries
    6
    I'll make sure it's in 2.1... or something nicer.
    Meh. | Twitter: @KierDarby | Web: KierDarby.com
     

  4. #4
    Senior Member RobAC has disabled reputation
    Join Date
    Jan 2001
    Posts
    1,296
    Kier,

    Thanks, this will definitely come in handy.
    Rob
     

  5. #5
    Senior Member Joshs has disabled reputation Joshs's Avatar
    Join Date
    Jan 2001
    Location
    hytekhosting.com
    Posts
    1,024
    What exactly does this do?
     

  6. #6
    Member SteveK is on a distinguished road
    Join Date
    Sep 2000
    Location
    Seattle
    Posts
    31
    You may also want to add this to remind you of the new variables that are available.

    find this:
    PHP Code:
      maketextareacode("Message:<p><font size='1'>In the message, you may use \$username, \$password and \$email.</font></p>","message","",10,40); 
    and replace with this:
    PHP Code:
      maketextareacode("Message:<p><font size='1'>In the message, you may use \$userid, \$activateid, \$username, \$password and \$email.</font></p>","message","",10,40); 
    SteveK
     

  7. #7
    Senior Member Black Tiger is on a distinguished road
    Join Date
    Mar 2001
    Location
    Netherlands
    Age
    46
    Posts
    530
    I've got a little problem with this one in VB2.0 final.

    I made changes to email.php like Kier said.
    Now I use the option "email users" in the control panel.

    I write the email, then I've got to select who to send to and I select "users awaiting email confirmation" (we've got 82 of them).

    After submitting I see:
    userid:
    done

    But no mail is send, even not when I select the option to mail users in this usergroup which post is <1 nothing is send.
    In vb1.16 if I selected only a usergroup, an email was send to the entire group.

    1.) Am I doing something wrong or forgetting something?
    2.) What does the "joindate" added in the first line exactly do?
    Please help.

    p.s. It seems it only works if I send an email to the usergroup "administrators", then I see the userid's, on any other group I see no id's flying over my screen.
    Last edited by Black Tiger; Sat 2nd Jun '01 at 12:28pm.
    Greetings, Black Tiger
     

  8. #8
    Senior Member Black Tiger is on a distinguished road
    Join Date
    Mar 2001
    Location
    Netherlands
    Age
    46
    Posts
    530
    Nobody any idea?
    Greetings, Black Tiger
     

  9. #9
    Senior Member Raptor is on a distinguished road
    Join Date
    Jan 2001
    Posts
    177
    this works fantastic on vb 2.01

    we have over 3970 members on the awaiting confirmation list because our sendmail function corrupted and they've just been sitting there doing nothing

    this should sort that out

    thanks again
    Proud owner of Vb @ http://digital-forums.com - the UK's largest Electronic Hacking Community & http://www.shopneo.co.uk the UK's fastest growing blank media company.
     

  10. #10
    Senior Member Byron is on a distinguished road
    Join Date
    Nov 2000
    Posts
    522
    Thank you so much Kier.

    I have 265 members waiting for confirmation.
    Can't imagine doing it one by one.

    Thanks a lot.

    Hope this feature will be in the next vb version.
     

  11. #11
    Senior Member Byron is on a distinguished road
    Join Date
    Nov 2000
    Posts
    522
    Found a something/bug

    I use the original template which contains $contactaddress and $bbtitle in my mail to members but the two variable didn't work

    "If you are still having problems signing up please contact a member of our support staff at $contactaddress

    Thanks very much,
    $bbtitle team"
     

  12. #12
    Former Lead Developer, vBulletin Kier is a jewel in the rough Kier is a jewel in the rough Kier is a jewel in the rough Kier is a jewel in the rough Kier's Avatar
    Join Date
    Sep 2000
    Location
    Reading, UK
    Posts
    8,228
    Blog Entries
    6
    Originally posted by Byron
    Found a something/bug

    I use the original template which contains $contactaddress and $bbtitle in my mail to members but the two variable didn't work

    "If you are still having problems signing up please contact a member of our support staff at $contactaddress

    Thanks very much,
    $bbtitle team"
    I'm not sure where you've got $bbtitle and $contactaddress from - the only variables available are $email, $password, $username, $userid,$activateid and $bburl...

    In any case, this hack is now included by default in vB 2.0.2 (along with $bbtitle )
    Last edited by Kier; Fri 27th Jul '01 at 9:05pm.
    Meh. | Twitter: @KierDarby | Web: KierDarby.com
     

Similar Threads

  1. Replies: 35
    Last Post: Thu 7th Sep '06, 11:30am
  2. [RELEASE: Mass Email to users awaiting activation code]
    By Scott MacVicar in forum Releases: Version 2.x
    Replies: 1
    Last Post: Sat 8th Sep '01, 5:10am
  3. Resending activate email
    By someone in forum vBulletin 1.1.x Questions
    Replies: 3
    Last Post: Sun 8th Jul '01, 7:19pm
  4. Activate Email URL bug
    By JonnyQuest in forum vBulletin 1.1.x Bug Reports
    Replies: 1
    Last Post: Thu 18th May '00, 12:40am

Bookmarks

Posting Permissions

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts