Issue
I want to add a button in my email query that can change a column in a row of a spreadsheet attached. Specifically, I want to have an "approve" and "deny" button in the email that changes the approval column of a product order to say approved or denied.
Resolution
The solution involves adding an HTML button to the email query that opens an Appsmith app with a query parameter containing the ID of the row to approve. The Appsmith app can then use this ID to change the approval column of that product order to say approved or denied.
To implement this solution, you will need to create an Appsmith app that includes a database query to update the approval column of a row based on the ID passed in the query parameter. You can then embed this app in the email using an HTML button that links to the app with the appropriate query parameter.
Here is an example of how to create the HTML button to link to the Appsmith app:
<a href="https://appsmith.com/approve?id={ROW_ID}">
<button>Approve</button>
</a>
Replace {ROW_ID}
with the ID of the row to approve.
On the Appsmith side, you can access this with appsmith.URL.queryParams.id
anywhere in the page editor.