Is it possible with Commerce File and tokens to add a direct one-time file download link in the "order complete" email? I would like users to directly download their file(s) rather than have to log in and view their licenses.

The generated file download links would need to be obviously related to each license issued in the order, and if at all possible, be restricted to the download limit placed on the license.

This seems like a complex issue, and I'm not sure if there is or will be any solution, but I'd like to throw it out there and see if it's possible.

Thanks!

Comments

recrit’s picture

Title: Possible to send email with direct file download link? » Direct file download link

changing title to better reflect the feature request since a duplicate issue was requested at #1428824: File Direct Download Link

ebeyrent’s picture

+1

dustinbrunson’s picture

So, yeah this would be awesome. This is basic functionality that should work right out of the box. Ubercart does this with file downloads and paypal :)

brianlp’s picture

Any news on this? It really makes sense and it's frequently topic of my customer feedback.

A similar approach would be to redirect the user to the download after payment success.

bakulaw’s picture

Recrit Help!
My site allow users to upload file for processing and the system produce an output file that I want to add as commerce file order from code. I can't find any example of products created from code that includes a commerce file.

Thanks again....

rtdean93’s picture

Are there any updates on this solution?

Perhaps an easier question... what token can I use to add the link to the user's download page in the email?

brianlp’s picture

As far as I know there is no token for that perhaps because the module was developed for a different purpose. I tried some different workarounds, also tweaking the one-time-login after registration to redirect to the user's page, but nothing really worked out.

RealGecko’s picture

Looking for the same solution

nodecode’s picture

IMHO this is a major UI problem with Commerce File. Can there be some work on this?

pixelsweatshop’s picture

There are a couple of issues identified in this thread:

1. A direct link to download the file in the order email
2. A link to the user's download page in order email
3. Redirect the user to the download after payment success

I have worked out a simple solution to 2 and 3 that are easy to implement.

For #1, Use the 'Me' Aliases module http://drupal.org/project/me
This module allows you to rewrite UID paths to me/* e.g. user/1/licenced-files to user/me/licensed-files

So in your order email just add [site:url]/user/me/licensed-files

For #2, rather than redirecting them after checkout to the user's download page, they can get download links right at checkout. To do this, clone the existing view "User Licensed Files" and make a block. Change the contextual filter to use the "logged in user" rather than "UID from URL". Also add a filter criteria of Commerce File License: Granted date (>= -0 hours -10 minutes) or something similar, so they only see files they just purchased, rather than every file they have ever purchased. Then, configure that block to be displayed on path checkout/*/complete. This way when the users finishes making their payment, they are presented with all of the files they have access to and they can download them directly on the checkout page.

Hope this helps. :)

nodecode’s picture

@nicoz
Actually if the user is new to the site, the download links will not work because they have to first check their email, click the one-time login link (and supposedly they're supposed to change their password), and then figure out where their downloads are located. An easier method for a direct download link after purchase is to just add download links to the View that creates the line item output of the order, as I explain here #1906478: Allow one Anonymous download after purchase.

pixelsweatshop’s picture

Sorry I forgot to mention that I am using login toboggan immediate login feature and commerce login redirect to ensure they either login or register before completing checkout. As much as I would prefer anonymous checkout, but until this module supports it, I much more prefer to ensure the customers get their downloads

cindyr’s picture

Nicoz, you're a genius. Thank you! I used your suggested modules, added the block to the checkout page, and it works painlessly now (as opposed to the very painful process it was before). Thank you for taking the time to share your solution.

brianlp’s picture

Placing the view in the confirmation page is a great idea! Meanwhile, I have found an even simpler method for the login part. I use the "Immediate Login" module which logs in new users during checkout using rules. After payment success they have access to their files. There is no email validation, so this might be a no-go for some sites.

brianlp’s picture

@nicoz You wrote that you changed the contextual filter to use the "logged in user" rather than "UID from URL". I can't see this filter. Which settings do you have in your view to have this filter available?

pixelsweatshop’s picture

StatusFileSize
new149.81 KB

Under Advanced > Contextual Filters, click on Commerce File License: Owner uid

Under "Provide default value", change it to "uid from logged in user"

screenshot

brianlp’s picture

Ok thanks, now I got it. Somehow I was cauhgt in the section below (...filter value is available).

bojanz’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Status: Active » Fixed

Hello everyone.
I have created a 7.x-2.x branch (see details here) that aims to address the feedback that the 7.x-1.x branch has received.

Here's what 7.x-2.x brings to the table regarding this issue:
1) There is a checkout pane that shows a link to each licensed file on checkout complete. This link also works for anonymous checkout (though I should note that we too use commerce_checkout_redirect on all of our production sites).
2) There is a [commerce-license:access-details] token that will give you the list of licensed fails, linked to their download pages.
You can use this token in emails to direct users to their files (I've used the Message module to send an email for each activated license before).
If the user just completed checkout, he will be able to follow the link without logging in (because the checkout pane sets a special session token that lets him through). Otherwise he'll need to login, and after that file download will start.

I believe this is sufficient to cover the feedback here, so I'm closing the issue.
Let me know if we can improve this further.

For the record, I also like the idea of using the me module to direct the user to "user/me/licensed-files" (or user/me/my-files in 7.x-2.x) from an email, it seems a bit cleaner than listing all files.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.