Results 1 to 15 of 85
Page 1 of 6
FirstFirst 1 2 3 ... LastLast

Thread: [RELEASE v2] Auto-Welcome Email to New User

  1. #1
    Senior Member tubedogg has disabled reputation tubedogg's Avatar
    Join Date
    Feb 2001
    Location
    Medina, OH
    Age
    28
    Posts
    13,647
    Update - Apr 13 03:35 PM: I fixed another small bug that occured when you used email verification.

    ------------------------------------------------------------------------

    This hack was requested by RobAC. It sends a welcome email to a new registrant at your board automatically. You can change the email wording to whatever you like, and turn the feature itself on or off in your Admin CP. If you require your new users to verify their email, it waits until that is done to send the welcome email. Otherwise, it sends it right away.

    No demo, for obvious reasons. However, you can register at the vGeekIsland Board (link in my sig) to see it working. Or you could register there anyway, to help us build up our small community.

    For version: version 2, beta 5

    Files needed: none

    Files to edit: register.php

    Templates to create: email_welcome, emailsubject_welcome

    Instructions
    1] Open register.php in an ASCII editor (you know at this point why you can't open it in a WYSIWYG editor; if not, read any of the hack threads in my sig).
    2] Around line 414, find
    Code:
        eval("\$subject = \"".gettemplate("emailsubject_activateaccount",1,0)."\";");
    
        mail($email,$subject,$message,"From: \"$bbtitle Mailer\" <$webmasteremail>");
    
      }
    Right below this, add
    Code:
    // send a welcome email using email_welcome and emailsubject_welcome templates, but don't
    //   send it now if they need to activate their account
      if (!$verifyemail && $welcomeuser) {
        eval("\$message = \"".gettemplate("email_welcome",1,0)."\";");
        eval("\$subject = \"".gettemplate("emailsubject_welcome",1,0)."\";");
    
        mail($newuseremail,$subject,$message,"From: \"$bbtitle Mailer\" <$webmasteremail>");
      }
    // end send mail
    Then, around line 489, find
    Code:
    			eval("standarderror(\"".gettemplate("error_moderateuser")."\");");
    		} else {
    Add right below it
    Code:
    			// send a welcome email using email_welcome and emailsubject_welcome templates but only if it's on
    			if ($welcomeuser) {			                  $email = $userinfo[email];
    			  $username = $userinfo[username];
                              eval("\$message = \"".gettemplate("email_welcome",1,0)."\";");
                              eval("\$subject = \"".gettemplate("emailsubject_welcome",1,0)."\";");
    	                  mail ($email,$subject,$message,"From: \"$bbtitle Mailer\" <$webmasteremail>");
    			}
    		        // end send mail
    3] Save and upload register.php. Then upload welcomemysql.php to your forums /admin directory. Go to http://yoururl.com/forums/admin/welcomemysql.php in a browser. If it is successful, it will display a link to you Admin CP.
    4] Follow the link, and then create two new templates. First, one called email_welcome, filled with this:
    Code:
    Dear $username,
    
    On behalf of the $bbtitle team, I would like to welcome you to our forums.
    I hope you enjoy your stay and would like you to know that if you ever have any problems, please do not hesitate to contact me or one of the other team members.
    I have listed our emails below for future reference.
    
    Once again, thanks for joining us!
    I hope you have a long and enjoyable stay with us.
    
    Sincerely,
    the $bbtitle team
    Then, create another one called emailsubject_welcome and fill it with this:
    Code:
    Welcome to $bbtitle!
    That's it. You can check out the new option under "Change Options" in the Admin CP.

    Instructions are also in the zip file - welcome.txt.

    Please do not PM me or contact me via AIM or ICQ about this hack. Post your message here - I will see it and try to help you.

    Enjoy!

    Edit: Almost forgot this. In the email_welcome template, you have these variables available to you:
    $username - inserts the username of the recipient
    $bbtitle - inserts the title of your BB
    $u - inserts the userid of the recipient
    $email - inserts the email address of the recipient
    $webmasteremail - inserts the webmaster's email address
    Last edited by tubedogg; Fri 13th Apr '01 at 4:36pm.
     

  2. #2
    Senior Member chrispadfield is on a distinguished road chrispadfield's Avatar
    Join Date
    Aug 2000
    Location
    London, UK
    Age
    28
    Posts
    5,368
    thanks for writing this out. I have been meaning to add this is and glad you have done.
     

  3. #3
    Senior Member jojo85 is on a distinguished road
    Join Date
    Jan 2001
    Location
    FRANCE
    Age
    24
    Posts
    916
    Oh
    Thx you very much guy
    Best Regards,
    Geoffrey 'G3oW0RK' BALDET.
     

  4. #4
    Member bokhalifa is on a distinguished road bokhalifa's Avatar
    Join Date
    Feb 2001
    Location
    u a e dubai
    Age
    33
    Posts
    99
    good hack
    thanks

    tubedogg
    In Dubai every thing is different
     

  5. #5
    Senior Member RobAC has disabled reputation
    Join Date
    Jan 2001
    Posts
    1,296
    Hmmmmm....Kevin, when does the email get sent out to the user? I ran a test twice by registering the username of test and I didn't receive the welcome email. It is set to YES in the control panel and the hack installation was successful. It was a breeze to install. Any ideas?
    Rob
     

  6. #6
    Senior Member tubedogg has disabled reputation tubedogg's Avatar
    Join Date
    Feb 2001
    Location
    Medina, OH
    Age
    28
    Posts
    13,647
    If you use email verification, it should get sent after the email is verified. If not, it should get sent right after registration.

    Double-check that you saved and reuploaded register.php (I forgot to do this at first...).

    Other than that, I can't think of any reason why it wouldn't work...You said it appeared in the control panel, which is right. And it's set to yes, which is right.

    Hmm...one thing to try. On lines 426 and 498, which should look like this:
    Code:
    	          mail ($newuseremail,$subject,$message,"From: \"$bbtitle Mailer\" <$webmasteremail>");
    change it to this
    Code:
    	          mail($newuseremail,$subject,$message,"From: \"$bbtitle Mailer\" <$webmasteremail>");
    I can't imagine that would make a difference, though...
     

  7. #7
    Senior Member RobAC has disabled reputation
    Join Date
    Jan 2001
    Posts
    1,296
    Verifying now....code is all there in register.php. I'll try making the code change you suggest and see what happens. I registered two separate test users last night and did not receive the email.
    Rob
     

  8. #8
    Senior Member RobAC has disabled reputation
    Join Date
    Jan 2001
    Posts
    1,296
    It worked! Taking that space out after "mail" in the code worked. Don't ask me why, it doesn't make any sense, but I've tested it twice with email verification turned off and on and it worked both times.

    However, there is something strange...with email verification turned off, the message starts out as expected:

    Welcome test, (test is the username)

    With email verification turned on, the message received after verification starts out like this:

    Welcome ,


    Any ideas?
    Rob
     

  9. #9
    Senior Member tubedogg has disabled reputation tubedogg's Avatar
    Join Date
    Feb 2001
    Location
    Medina, OH
    Age
    28
    Posts
    13,647
    On line 493 of register.php, try changing
    Code:
    			  $emails = $DB_site->query_first("SELECT email,username FROM user WHERE userid='$u'");
    to
    Code:
    			  $emails = $DB_site->query("SELECT email,username FROM user WHERE userid='$u'");
     

  10. #10
    Senior Member RobAC has disabled reputation
    Join Date
    Jan 2001
    Posts
    1,296
    No email sent.
    Rob
     

  11. #11
    Senior Member tubedogg has disabled reputation tubedogg's Avatar
    Join Date
    Feb 2001
    Location
    Medina, OH
    Age
    28
    Posts
    13,647
    On lines 493-495, try changing
    Code:
    			  $emails = $DB_site->query("SELECT email,username FROM user WHERE userid='$u'");
    			  $email = $emails[email];
    			  $username = $emails[username];
    to this
    Code:
    			  $email = $userinfo[email];
    			  $username = $userinfo[username];
     

  12. #12
    Senior Member RobAC has disabled reputation
    Join Date
    Jan 2001
    Posts
    1,296
    Bingo! Nice job Kevin. It works great now!

    -Rob
     

  13. #13
    Senior Member tubedogg has disabled reputation tubedogg's Avatar
    Join Date
    Feb 2001
    Location
    Medina, OH
    Age
    28
    Posts
    13,647
    It seems odd that no one else ran across this error mine...is no one else using email verification? Or is it just no one has installed it? Anyway I fixed the problem both in the instructions and the zip file.
     

  14. #14
    Senior Member RobAC has disabled reputation
    Join Date
    Jan 2001
    Posts
    1,296
    Oh oh......I just had a new member sign up and I received the welcome email! LOL Time to go look at the code again....
    Rob
     

  15. #15
    vBulletin Team Wayne Luke is a name known to all Wayne Luke is a name known to all Wayne Luke is a name known to all Wayne Luke is a name known to all Wayne Luke is a name known to all Wayne Luke is a name known to all Wayne Luke's Avatar
    Join Date
    Aug 2000
    Location
    So. California
    Age
    38
    Posts
    34,676
    Blog Entries
    1
    Why not use $bbuserinfo[userid] and $bbuserinfo[email]. Would cut down on the number of queries needed in fact it should eliminate any extra queries.

    These should contain valid data if the member is already registers.
    Wayne Luke
    Get started with your own social network.
    Purchase and download vBulletin today.
    vBCodex (Running vB 4.0 Suite) - Take your vBulletin Community to the next level. Modification tips, tricks and support.
     

Page 1 of 6
FirstFirst 1 2 3 ... LastLast

Similar Threads

  1. Auto Welcome PM instead of email?
    By Mainer82 in forum vBulletin 3.0 How Do I and Troubleshooting Forum
    Replies: 6
    Last Post: Tue 23rd Dec '03, 10:43pm
  2. Auto Email Notification
    By gwdguy in forum vBulletin 2 'How Do I' and Troubleshooting
    Replies: 5
    Last Post: Sun 10th Mar '02, 2:23am
  3. Auto Welcome New Members via Email for v2.0.3 ?
    By Byron in forum vBulletin 2 'How Do I' and Troubleshooting
    Replies: 4
    Last Post: Tue 23rd Oct '01, 11:27am
  4. [pre-release Auto IP/OS/IE Parse Hack]
    By ztsky in forum Releases: Version 2.x
    Replies: 4
    Last Post: Mon 23rd Jul '01, 2:02am
  5. [RELEASE vB2.0] Auto Refresh 2.0
    By PeF in forum Releases: Version 2.x
    Replies: 30
    Last Post: Thu 19th Jul '01, 2:07pm

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