Recently I was looking for a way to capture customer lead information at the point a user attempts to download a document from our site.

Then I started to think can I tie in subscribing them to a MailChimp list at the same time. I searched around for suitable plugins as I don’t want to have to hack the solution, but couldn’t really find anything to do what was needed in a single plugin. There are some great document management plugins and there are some plugins specifically to get email addresses before downloading or subscribe before downloading, but I found the doc management plugins too much for what I need and the email / subscribe plugins needs a form on the page where want the download link (not ideal if you want a list of multiple download links on the same page).

So to achieve a neat solution you need the following plugins:

The process goes like this:

1. Click on a document download link on the page

Screen Shot 2014-03-12 at 22.03.09

2. User presented with a CF7 form on a new page including an opt in to MailChimp list (file name for download passed via url using CF7 dynamic text)

Screen Shot 2014-03-12 at 22.05.12

3. Fill out the form then CF7 onscreen confirmation message pops up including download link (created from file name in url)

Screen Shot 2014-03-12 at 22.06.08

4. Download link also sent to users email using CF7 confirmation email

5. User subscribed to MailChimp list using MC4WP (via MailChimp double opt-in confirmation email process)

To achieve this:

1. Install the 3 plugins

2. Upload your files for download to a suitable folder within the site directory.

3. Create your download link in the page:

Screen Shot 2014-03-12 at 21.40.21



Instead of linking directly to the file, create a link to another page (where you can add your CF7 form) adding the following to the url:

“[newpage]?download=[filename]” where [newpage] is the url to the page, and [filename] is the filename of the file you intend to provide for download. ‘?download’ gives us a variable to be picked up in our CF7 form.

4. Create your CF7 form adding in merge fields that match your MailChimp List fields and preceeded with “mc4wp-” to allow MC4WP to pick up the values to be passed up to MailChimp. Note the MC4WP plugin requires EMAIL and FNAME as a minimum:

Screen Shot 2014-03-12 at 21.23.45

Notice the field [mc4wp_checkbox “Subscribe”] which adds the checkbox for MC4WP to automatically subscribe the user to your MailChimp list (the checked / unchecked status of this field is read from your MC4WP checkbox settings in the MC4WP plugin).

Also notice the field [dynamictext download uneditable “CF7_GET key=’download'”]. This field is powered by the CF7 Dynamic Text Extension plugin and picks up the value of the variable ‘download’ passed over in the link url from the original page – once its available in the CF7 form we can use it to build the download link url.

5. Amend the CF7 confirmation message – this is where I set the download url using the file path of the folder and the file name taken from the [download] value passed from previous page:

Screen Shot 2014-03-12 at 21.34.54

 6. Amend the CF7 email messages – again I included the download link as above.

7. Lastly add your CF7 form shortcode to the page you directed the link to – maybe call it something like “Document Download”

There’s plenty of support available for all of those plugins via their support pages.