www.webdeveloper.com
Results 1 to 7 of 7

Thread: Grant access to Download after Newsletter Subscrition - Best practice

  1. #1
    Join Date
    Nov 2017
    Posts
    7

    Grant access to Download after Newsletter Subscrition - Best practice

    Hello!

    I'm searching for ways to grant access to download a file, only after subscibe to a newsletter. What are the best practices or your experiences to do solve this task?

    It's about a Wordpress website. So far I did this steps:

    1. A Popup (boxzilla) with the newsletter subscription (Mailchimp) appears after user clicks a button
    2. Now the user have to fill out the email field.
    3. The mailchimp registration will follow, after clicking submit
    4. now I'm planning to write a script, so that the click also starts the download (jquery.onclick() ?)



    But I want also to track, if a user filled out the email field or not. Everything possbile with little coding, but is that the best practice? I could see that kind of registration often on other sites. How they are doing that? Maybe there exists also a good plugin to handle all this stuff including tacking?

    hanks in advance for your help

  2. #2
    Join Date
    Nov 2017
    Posts
    7
    Currently I added this script directly to the popup, but it doesn't work:

    <script>
    jQuery('.popup-newsletter_button').click(function(e) {
    e.preventDefault();
    window.open('https://my-site.com/download.pdf');
    });
    </script>

    How could I open the link after the mailchimp request ("thank-you" will appear, after subscibe in the popup).

    By the way, is there now way in this forum, to edit a post?

  3. #3
    Join Date
    Oct 2013
    Location
    Sheboygan, Wisconsin
    Posts
    1,632
    After the first few minutes, the edit disappears.

  4. #4
    Join Date
    Nov 2017
    Posts
    7
    nobody an idea, how to restrict a download with jquery,html,php?

  5. #5
    Join Date
    Nov 2017
    Posts
    9
    Assuming after sign-up the visitor is now a member of your site?

    All you then need to do is redirect them to the page, and wrap your content with appropriate short codes. As the shortcodes are evaluated before the page is sent to the browser there is no way a non-member can access the content.

    Take a look at this example

    http://justintadlock.com/archives/20...s-only-content

  6. #6
    Join Date
    Nov 2017
    Posts
    7
    thanks for your answer! Looks interessting.
    My solution was to open a popup after clicking a download (using the wordpress plugin boxzilla). On this popup I've put a form of the simple Pluginemail-download-link/. After send the email adress, the plugin is sending the downloadlink to the user. At the same time I add the user to a mailchimp list.

  7. #7
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    5,762
    No idea but if this were me, I would have the page collect details to sign up, then they get passed to the server and the server sends an email out to the clients email address with a onetime URL in it to get the download. Then in the database you can store the corresponding hash key if you are going to issue a URL that contains a hash key as a parameter (query string) or URL rewriting if you generate a URL that will be remapped to the data file via a read function.

    In the server, use URL rewriting or the query string method, re-order it or database query to test if that hash key has been expired... add to the URL path you decide on as a URL in the email then the donload script that gets called can use a file read function to output the file as a download.
    --> JavaScript Frameworks like JQuery, Angular, Node <--
    ... and please remember to wrap code with forum BBCode tags:-

    [CODE]...[/CODE] [HTML]...[/HTML] [PHP]...[/PHP]

    If you can't think outside the box, you will be trapped forever with no escape...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center

"

"