Sending URL Parameter Into an Email for Native app

Hi,

I’ve made a 1 page mobile app (I have an Index page and all of the other “pages” are Groups that I hide and show).

It consists of many “things” of a single type (like Posts, if you will), that others can comment on.

My goal, which I’m having trouble with, is to pass a page parameter (of a Post) into an email, so that when someone clicks the email link, it will load the Index page, detect if that page parameter is there, and open the corresponding View of that “thing” accordingly - explained with an example below…

So Person A creates a post, and then let’s say that Person B comments on it. I’m then triggering an email notification to Person A (via a SendInBlue template) that Person B commented on it. I want to make it so that the email that Person A receives includes a link with that “thing”/Post in it, so that when he opens it, it opens the app and then opens that specific “thing”. More specifically, my intention is for it to open the Index page (which is my only page), and then have a Workflow on pageload that if the URL contains a parameter with one of those “things”, it should trigger the Group (that displays the View of that type of “thing”), and pass that "thing"s parameter to the Group to open it (so that he doesn’t have to go searching for it to see the comment).

I believe I have it all working, except for 1 part that I can’t figure out (mentioned above), which is how to pass that “thing” as a parameter INTO the email link that I’m sending out. I know that parameters can be passed when transitioning pages, but I can’t figure out how to pass a URL parameter into an email.

Anyone have any ideas?

Thanks in advance.

1 Like

Are you using the built in, send email function or are you using an external service?

I’m passing the Thing’s unique ID into a parameter for the email, it looks like this: ?job=%JID%

The url to the app is put in front of that.

Then there is an input on the page that has get parameter ‘job’ from url and a workflow that triggers a group to show and load the thing that has that unique ID. (do search for things where ID= get parameter’s ID.

So, not sure what you exactly can’t get to work, but you should have access to the post that was created by Person A and put the ID of that thing in the url parameter.

Otehrwise, maybe share some screenshots or better, your editor.

1 Like

Thanks for the response.

Yes, I believe that is exactly what I need to do - I think it’s just the formatting of the parameter I need to get right…

So do I need to do it like this? (the “thing” is an “insight”)

image

That could work, I don’t see the full url but why not give it a go and see what happens :smiley:

I tried. Didn’t work :frowning:

Any other ideas? :slight_smile:

Here’s what I’m running on pageload:

image

But do you see anything in the url? In the email you send?

Maybe better to share the editor

For formatting, keep in mind is that parameters are case sensitive. Ie. “insight” (lowercase i) is different than “Insight” (capitalized I).

As well, if your values in your parameters have anything odd in their structure, that may throw things off. (This StackOverflow thread gives some good pointers). It’s best to take a look at your debugger how the URLs are captured.

Remember that you can always construct any url you want from scratch, just as long as you know the URL construction that gets you where you want to be. ie. yourappname.com/profile?user=johnsmith&tab=contact&message-id=12346789x987654321.

Mozilla has a really good primer on understanding URL construction.

So here’s what I’m seeing immediately in the URL after I open the email link:

domain/version-test/index/sample:custom.insight?debug_mode=true?insight=1529289570164x782763756848939000

When the Index opens up, it’s running this:

Which is set to this:

image

What happens is that it loads the Index and then this part disappears from the URL:
?insight=1529289570164x782763756848939000

It becomes this:
domain/version-test/index/sample:custom.insight

So then I tried removing the “Only when” and opening the URL again - this time, it opens the Insight “View” Group, but with no content (since the id disappeared from the URL, I’m guessing it doesn’t have that information anymore and had nothing to load).

Any ideas why it might be getting rid of the id when the page loads?

Is there a reason you have “insight” in your URL twice? While I don’t think that Bubble would confuse them, it may be a cause for error. (And prevents you from properly using the “this URL contains” function.

The second issue I see is that after the debug_mode=true parameter, you have a “?”

When constructing parameters, you signify the first parameter with a “?”, then any subsequent parameters with a “&”. Try fixing that first.

Regardless, if you have a navigation event (or refresh), you will likely lose the original parameters unless you specify them to be carried over.

If you can share your editor, it is easier to debug!

Got it!

Thank you both!

@dan1, your last one helped me figure it out - it was a tricky one.

Being in debug module automatically puts a ? in the URL, so when I was adding the ? for the “insight”, it was actually the 2nd one in the URL.

So I figured that if I push it live and I don’t do it in debug mode, the debug mode ? won’t be there. I pushed it live and it worked :slight_smile:

Thanks for the help.

Happy to help. Glad that worked!