Sending link in email

Hi, first post on the forum and first month on bubble.

I have an app that is meant to collect a Purchase Order delivery date via an input in a calendar and populate it in the Purchase order line delivery date field.
When a purchase order has no delivery date, I created a workflow that sends an email to a supplier and requests the delivery date. The email contains PO identification elements (PO Number, Supplier, etc), dynamic data that I defined in the Send Email action. The email also contains a link to a page that displays a calendar where the user can select a date and save.

This is where my problem is: I cannot work out how to load the page in the context of the Purchase order / Purchase order line information that I already brought in the email hence I don’t know how to direct the calendar input to the right record that needs to be updated. Anybody has any idea? Thanks in advance

Hi, anybody has any idea? Thanks a lot for the help

Is your link something like https://www.yourapp.com/po_date (where po_date is the page the user selects a date for the delivery date)?

If so, can’t you just make your link https://www.yourapp.com/po_date?arg_po=1234567890 and have the page populate itself based on the arg_po value via a get data value from URL call?

1 Like

Yes, this solved my problem. Thank you very much for the help @firstfifteensoftware.

I’ve extracted the PO number by truncating the URL to last 3 and that solved it. However, this might be an issue when the PO number increases but I am still thinking how to solve it.

Another issue that I discovered is that if somebody intentionally changes the last three elements of the URL, it can retrieve another PO information that might not even be theirs. Keep in mind that whoever interacts with the calendar is a non-user as default. This is one for me to think as well

"Another issue that I discovered is that if somebody intentionally changes the last three elements of the URL, it can retrieve another PO information that might not even be theirs. "

Do you have some way to determine if the current user is the owner?

I have one screen similar to what you are doing here. My retrieval has additional search criteria (translated a bit to fit your situation):

po_owner_email = current user’s email

This way, even if they change the PO# in the url, there’s an additional check to make sure they have rights to see that PO. For me, I show a pop-up saying that the PO is invalid and send them back to a prior page.

I am afraid this will not work since the user that clicks the url takes the user to a page that does not require log in. Still looking into this…

After giving it more thought, I am using something similar to your solution but I do a different verification. This was a great idea. Thank you!!

Off to my next one: I am talking in my initial post of an email that is sent when a date is not available. This email is sent only when I press a button in my app. Did you find a way to automate this and let’s say have the app verify itself if the date is available and send an email at predefined times? I am looking at sending an email 3 days after a PO date, follow-up every day for the next 3 days, escalate in the 4th day and generate an alert type of report 1 day after the escalation happened if the date is still not available.
I have a feeling it has something to do with the backend workflows but I couldn’t wrap my head around it

Backend workflows are incredibly difficult to understand.

Then once you understand them, you’ll wonder why you were ever confused in the first place.

For your case, I’d do the following:

  1. Create a new API workflow. Something like this:

In the part marked “Only when” on the bottom, enter in some criteria to confirm the condition you want this workflow to run. For you, you want the workflow to run only if the date is still not available, so do your search here. Of course, you’ll probably need to enter in more Key values for your search.

  1. Add an action to this workflow to send your email. Make sure your workflow gets all of the info it needs to send the email.

  2. Add additional code behind the button you are using to send your email. This code will call your new workflow in 3 days. I have something similar which deletes cart items for me after they’ve been in a cart too long.

Your code would look something like:

Because you are scheduling this, you don’t need to worry about triggering the email three days later. You’re basically telling Bubble to do the work for you 3 days from now.

For your follow-ups every day for the next 3 days, just create additional new workflows to be triggered in 4 days, 5 days and so on.

You can add and trigger your elevate stuff the same way.

First of all Thank you very much! I am extremely grateful for your help! I will try these days and come back with whatever I will be able to do. Again: Thank you!!

i got this done a while ago. Worked like a charm. Thanks again.

1 Like