1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.3 Redirect after clicking on confirmation mail link

Discussion in 'Styling and Customization Questions' started by alvarofloresmx, Jun 28, 2014.

  1. Hi there!

    I've been searching all day but I can't seem to find a way to automatically redirect (if possible after 3 seconds or so) a user to my blog site at www.site.com instead of just waiting for the user to click something.

    I've hear it has to do something with:
    Admin CP -> Appearance -> Templates -> register_confirm
    or
    Admin CP -> Appearance -> Templates ->register_process


    Example:
    -New user registers, and a message of a confirmation email has been sent
    -New user goes to email account and clicks link
    -A page with "Your account has been confirmed"
    (3 seconds after)
    (redirects to www.site.com)

    My forum url is: www.site.com/forum
    My blos ulr is: www.site.com

    I would really appreciate your help with this, it might be an easy one but I just can't understand xenforo hooks.
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Add this code to either template (or both):

    Code:
    <script type="text/javascript">
    	$(document).ready(function(){
    		setTimeout(function(){
    			window.location = 'http://www.apple.com/';
    		}, 3000);
    	});
    </script>
    
    This is javascript to redirect the user after 3 seconds. Just put your URL in there.
     
    alvarofloresmx likes this.
  3. This worked like a charm! Thanks a lot Jake.
    I saw people could rely on you and I see why you are awesome! :D

    Have a good one
     
  4. BTW
    Is it possible to do it in a new tab instead of reloadint the same page?
     
  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Code:
    <script type="text/javascript">
    	$(document).ready(function(){
    		setTimeout(function(){
    			window.open('http://www.apple.com/','_blank');
    		}, 3000);
    	});
    </script>
    
    You will find that most browsers block this by default.
     

Share This Page