How to Capture Email before Downloading a File in a post on WordPress

You might have come across many sites over internet which asks you to put in your email and take a file ( like PDF ) in return. If you ever wondered how this can be done on WordPress site then follow these steps.

What all you’ll need:

To get this done you will need 3 WordPress plugins:

  1. Email before Download
  2. Contact Form 7
  3. WordPress Download Monitor

Lets Start:

  1. Install all the three plugins i mentioned above.
  2. Go to Email before Download plugin settings ( http://example.com/wp-admin/options-general.php?page=email-before-download ) and setup  Delivery Format, Hide/Mask Real Link, Link Expiration Time values as per your requirement and hit ‘Save Changes’.
Email Before Download
Email Before Download

3. Now navigate to Contact Form 7 settings and create a contact form ( on left menu Contact > Add New )

Contact Form
Contact Form

READ: How to get an attractive image for your Blog Post ?

4. Give a title to form, remove unwanted fields(highlighted here, else if you wish you can keep them as well) from the form and Save.

Form Creation
Form Creation

5. Once you save the form, make note of the form ID, we’ll use it later ( here it was 825).

Form Created
Form Created

6. Now go to Download Monitor and Add the file which your readers will download ( On left menu Download > Add New ).

Add File

7. Give a title to Download ( this will be shown to your readers once they fill up the form and submit).

Add File Page
Add File Page

Don’t forget to make a note of the File ID as well, highlighted in the picture above.

READ: Make your Menu look awesome with ‘Menu Image’.

8. Add the file using file Downloadable Files/ Versions section

9. Hit Publish.

10. Now create a Page/Post, whichever you want to keep  your file at and insert below code.

Code
Code

Where X will be the file id ( for me it was 850, can vary for you ) and Y will be Contact Form ID ( for me it was 825, may vary for you ).

11. Save and Publish the Page/Post.

Here is a sample which i created as a demo.


 

Do let us know your thoughts in comments section below.

6 thoughts on “How to Capture Email before Downloading a File in a post on WordPress

  1. Hi Abhi,
    Does this solution still work? I tried to look for the Email Before Download plugin but I couldn’t find it. Thanks.

    1. Hello Mattyps,

      Thanks for your message, yes the plugin is no longer available on WordPress directory. An alternative solution can be using ‘Gravity forms’ and provide link to file in submit confirmation message.

      Regards,
      Abhi

  2. Hi, I found your post through google search. Thank for the brilliant tutorial that solved my problem half way. The reason is because after I pressed the submit button, I keep seeing ajax spinner spinning, and also received an email notification about someone is interested on downloading my file. But I don’t see the link showing up… May I know what could be the problem? Thank you.

    1. Hello Julie,

      Please try to check Contact form configs, or use ‘WP-Mail-SMTP’ for any issues around Contact form 7.

      Regards,
      Abhi

    1. Hello Julie,

      Thanks for pointing out this, yes the plugin is no longer available on WordPress directory. An alternative solution can be using ‘Gravity forms’ and provide link to file in submit confirmation message.

      Regards,
      Abhi

Excited to hear from you, comment below !