WordPress: Force Contact E-mail before Allowing a File Download CodeUnit 25 SEP 2012

The other day one of the WordPress sites I was asked to help out on (http://www.portsevolution.com) needed a solution whereby they first needed to receive some contact details before allowing a reader to download an associated PDF file.

Digging around the WordPress plugin repository I came across a great solution in the form of a plugin by M&S Consulting, entitled “Email Before Download”, which basically combines the functionality of the excellent WordPress plugin “Contact Form 7” with that of “WordPress Download Monitor” to achieve the required functionality.

Taken from their official description: Email Before Download presents your users with a form where they submit information, like their name and email address, prior to receiving a download. This plugin integrates with the popular Contact Form 7 and WordPress Download Monitor plugins, allowing you to create any form you like and manage/monitor your file downloads. You can also export a list of users that have downloaded files from the plugin’s settings page.

As an option, you can configure Email Before Download to:

  • Display a link to your file directly under the contact form once it is submitted. This happens dynamically, inline of your post/page.
  • Send the user an email with a link and/or attachment to download your file.
  • Combination of both #1 and #2

To use is ridiculously easy. First, ensure that you download, install and activate the three required plugins, namely “Email Before Download”, “Contact Form 7”, and “WordPress Download Monitor”.

Now create a contact form to be used by Email Before Download by using Contact Form 7 and note the newly added contact form’s ID value. Next, upload a file using Download Monitor and note the download item’s ID value. Finally, edit the page or post that you wish to include this download on, and add the shortcode shown below, obviously substituting in your collected ID values:

[email-download download_id="X" contact_form_id="Y"]

Simple, and really, really effective.

Related Link: http://wordpress.org/extend/plugins/email-before-download/

Related Posts:

About Craig Lotter

South African software architect and developer at Touchwork. Husband to a cupcake baker and father to two little girls. I don't have time for myself any more.