Get answers quicker by searching

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

Anyone willing to share AJAX script to subscribe users?
  • Vote Up0Vote Down yousendmeyousendme
    Posts: 20Sendy user

    When a user subscribes, it takes them to a congrats page saying 'You're subscribed!'

    From this thread http://sendy.co/discussion/565/subscribe-success-page-redirect-page-to-previous-page#Item_3

    I understand I could use some AJAX to redirect users back to the home page. Being a complete novice to ajax and thinking it's a small miracle that I proudly got Sendy working, installed DNS records and domain keys on my server, I thought i would turn to you guys who may be doing something similar!?

    Any code someone is willing to share? :)

  • 6 Comments
  • Vote Up0Vote Down BenBen
    Posts: 3,507Sendy support

    Hi @yousendme,

    I understand I could use some AJAX to redirect users back to the home page.

    You don't need AJAX to redirect users back to your homepage.

    Just set the custom URL you want to redirect users to after they subscribe in your list settings.

    Thanks.

    Ben

  • Vote Up0Vote Down yousendmeyousendme
    Posts: 20Sendy user

    I've tried that but when a user subscribes it doesn't go to the success page and then back to the home page. The page just refreshes and doesn't give an indication the user is subscribed. I would like it to go to the mydomain.com/sendy/subscribe page first to indicate it was successful and then redirect elsewhere

  • Vote Up0Vote Down BenBen
    Posts: 3,507Sendy support

    Hi @yousendme,

    Are you using the subscribe form HTML code?

    Ben

  • Vote Up0Vote Down yousendmeyousendme
    Posts: 20Sendy user

    Yep

  • Vote Up0Vote Down BenBen
    Posts: 3,507Sendy support

    @yousendme,

    If you use the subscribe form HTML code on your website, upon user subscribe, they will be brought to the "You're subscribed" page. Is that not the case for you?

    The page just refreshes and doesn't give an indication the user is subscribed.

    I went to your website to subscribe to your list and it works.

    If you want the user to be brought to a 'success page', then back to the 'home page', you will need to code a page (lets call it thankyou.html) that says "You're subscribed" then use javascript to delay for a few seconds before redirecting to the home page.

    Then use http://your_website/thankyou.html as your custom redirection URL in your list settings.

    Thanks.

    Ben

  • Vote Up0Vote Down BenBen
    Posts: 3,507Sendy support

    @yousendme,

    I have written the thankyou.html script for you. Download it at http://cl.ly/MRry

    Change the variables if necessary:

    • delay_in_seconds (the number of seconds before redirecting the user to your home page)
    • url_to_redirect (the full URL of your home page address)

    Upload this file in Sendy's main directory. So the URL will be http://your_sendy_installation_url/thankyou.html.

    Then use this URL as the Subscribe success page in your list settings of your preferred list.

    Thanks.

    Ben

This discussion has been closed.
All Discussions