Custom data in action URLs

Hi,

When composing a notification, it can be set to “Open URL” upon click/tap. In that field, the URL is parsed before being sent to the server. This prevents the interpolations for custom data from being sent in the URL outside the query string.

Take this URL for example:

https://example.domain/products/12/?track_id=22

Where “12” and “22” are dynamic numbers.

Inputting: https://example.domain/products/{{product_id}}/?track_id={{track_id}}
And passing the appropriate data will evaluate into this URL:
https://example.domain/products/%7B%7Bproduct_id%7D%7D/?track_id={{track_id}}
Which breaks the “product_id” segment of the interpolation.

This is caused by the “blur” handler, because it is parsing the URL for validation before sending it to the server forward, and it causes URI encoding on characters which should be preserved.

Before blur:
https:// aws1.discourse-cdn. com/standard11/uploads/wonderpush/original/1X/5773b684954355df57c83bd80c694dbd51b7de5c.png

After blur:

When passing “alert.targetUrl” from the API call and overriding this value properly (no need to parse your own data, but using the built-in interpolation) works as expected and the URL is parsed with the data expanded inside it properly.

Hi,

We’ve fixed the validation of the URL to no longer escape the curvy brackets.
You can now add parameters in the path as well as in the query string.

Best,

Seems to work great, thank you :slight_smile:

@olivier I stand corrected.

It appears now that whenever I put params like this into the URL it breaks sending and notifications never arrive at all.

I mentioned in another post: Installation.custom is empty that sending doesn’t work for me at all.

I have confirmed this is the culprit.

Now the workaround I used before of adding ?redir= as a prefix to the search segment of the URL, which was handled by my client code to perform the actual redirect, doesn’t work anymore - it is also broken.

To simplify:

https://domain.com/test                         # pass
https://domain.com/{{param}}/?redir={{param}}   # fail
https://domain.com/?redir={{param}}             # fail
https://domain.com/{{param}}/URL                # fail

They pass UI verification and are saved properly, but in actual use they fail to send for me.

I have confirmed this with a brand new project so it should not be fouled by bad edits before or broken informations.

For the record, both issues OP has been facing were solved using the chat on our dashboard, which allows for a more timely and interactive problem resolution experience.
I’m going to close this topic.