Email a dynamic download link for each transaction

Use case: A customer selects an audio file from a repeating group, then selects to purchase an MP3 or MP3 + WAV of the selected audio. After they have paid, they then sign a contract, once the contract is signed, I want a workflow to email them the selected audio file in MP3 or WAV as selected.

I already have the files saved in the back-end, I just need to know how to attach a dynamic file, based on user selection via Sendgrid automatically, after “save” has been clicked.


.

How can a [dynamic] FILE option be attached and sent via the “send email” command? Or how to I generate a unique download link to a customer for each transaction?

I’m thinking a work around to this is going to be providing a link to a designated download page. I just need to figure out how to create a unique download page for every sale. Any ideas on how to approach it this way instead?

You cannot attach file to native email action. You can only add the link.

For you workaround, I guess you have a Sales types thing (DB).
You can just Create a download page, set thing to Sales And use the unique ID in the link.
For example, if your page is named downloadpage, this will look like https://yourappname.bubbleapps.io/downloadpage/Sales item’s unique ID
(and this will give https://yourappname.bubbleapps.io/downloadpage/123456789x123456789)

I was thinking the same thing, but my dilemma is I’m passing along the selected “Beat”(music audio file) from page to page, not the “Sale” because I need to display data about the “Beat” through the process. so generating or matching the Unique ID is problematic.

I can’t use the “Beat” “unique ID” as a “Sale ID”, or maybe I can? They will need the ability at the end to download a signed copy of a contract and the audio file. The contract gets stored in the “Sale”.

I hope this makes sense…

Not sure what you mean because I don’t know your setting, but there’s a lot of way like adding parameter to url you send and catch in to set thing of the page.



I’m sending the “Beats” data to each page, so nothing is triggering the generation of a Unique ID for the “Transaction” itself. So, I’m stuck…

What is the link between beat and transactions? I don’t see any link between them (Beats to transactions or Transactions to Beats)

So there are multiple beats for sale. Once you chose a beat, you then chose if you want to purchase an MP3 or an MP3 & WAV. After that you pay, then it takes you to a page to sign a contract. After the contract has been signed, you are then going to be sent via email the download link.

So, the link between transaction and beat is that you’re doing a transaction for a beat, that consists of a contract.

I think I may have found a way to force a Unique ID to be generated for the transaction.

Basically, I’m capturing one piece of information pre-maturely, to force a “create new thing”, so I can then use the results of the new thing being created to generate a transaction id. Then on a later page, I’m going to “do a search for” and match the IDs.

I’m going to bed, but here’s how I see thing
(just place replace thing according to your setting)
Beats: Are item that user can buy
Transactions: Shopping cart
Transactions have a field called Beats that is a List of Beats
When user shop, he add Selected Beats to the Transactions in Beats field. Go to pay, Sign the contract and receive a link to a page that is set to Thing transaction. The link will follow my first post setting.
Inthis page, you can set a repeating group with Beats for thing and source will be current page Transaction’s beats

Why do you Create a new transaction and make a change to transactions ID while this is… the unique ID of the transactions?! You can already use it without have a field that just duplicate the same information.

Because there is no unique id, until the new thing has been created

Maybe I’m going about this the wrong way. I just need something to work at this point.

When you said, “What in DB can you use actually to know which Beats are been purchased in a transactions?
I don’t see in Transactions thing a field called Beats that is a list of beats for example. (Maybe it’s in contract)”…It is the Beats name, the contract itself and the users information that I capture. I still have to add those fields in the DB.

Yea, this approach isn’t going to work either :angry:

…I need to take a break, I need a fresh mind to deal with this one.

Okay, so I figured out a solution. I’m sharing it just in case anyone in the future needs it as reference:

Essentially, I’m capturing all the customers data on the last page of the transaction, AFTER a payment has been made. Such as email they want it sent to, name, etc. Then, I’m passing the downloadable file from “Beat” in the database to “Transaction” in the database. The transaction ID that is generated is the “Unique ID”-“Customers Email”, so it is unique to every single transaction.

I then pass that to the “mp3_download” page and I have a group that displays the correct beat download, based off matching the “Transaction ID” with the URL path. The URL will read something like ".com/mp3_download/[uniqueID]-[CustomersEmail]

Now, I just have to add a send email function and make sure people can’t click “save” on the “mp3_sign_contract” page until everything has been filled out. The core functionality is there though and it works like a charm…

2 Likes