I have some users that receive an email based on a forms input. (think of it like an approval form). I want the recipients to tap 1 of 2 buttons on the email (approve or deny) and clicking either will run seperate queries in the app.
Is it possible to control if my approve and deny queries get triggered based on the url? I've been trying to do this through the URL parameters but i think im setting something wrong.
Short of this all i can think of is creating a seperate app so i'll have 1 that auto triggers approve and 1 that auto triggers deny.
You could use a JS Query to do this:
if( urlparams.action === 'approve' ) {
approveQuery.trigger()
} else {
denyQuery.trigger()
}
Set this JS Query to run on page load and make sure the other two queries are set to manually triggered.
1 Like
Can you advise how in the URL parameters do I set this up?
You don't need to do anything there. In the HTML that you send in the email you would do something like this:
<button href="{url_to_app}?action=approve">Approve</button>
<button href="{url_to_app}?action=deny">Deny</button>
That will allow urlparams to be available in your app.
That works great, thank you @Ron_West
1 Like