'Button function in a SendGrid Email to Trigger an external Webhook

forgive my naivete in asking this question, but I'm hoping someone can help me.

I have an email I send out through the SendGrid api using a dynamic template. The content of the email is different for each user I send it to (highly curated). I send products, their name, info, and a link to buy them.

I am looking to create a "LIKE" button next to each product for the user to interact with in the email and provide feedback on that product. That is, if they like that product but don't want to click to buy yet, they can hit "LIKE" and I'll be informed.

I am thinking I would do this through a webhook using something like integromat where a click of the button would trigger the webhook and then I would use something like airtable to update information.

Is something like this feasible? Would I just put the webhook URL in the href tag of a button? Is it possible to trigger the webhook AND then redirect to a window/tab that would acknowledge that the button was clicked?

Thank you for any feedback!



Solution 1:[1]

Links in an email will open a web browser outside of the email. This will make an HTTP request to the URL that you set as the HREF for the link (<a>). So, you can point that HREF directly at an endpoint on your own application and handle the request, storing the data about which user liked which product and rendering or redirecting the user to a confirmation page.

I think you may be complicating the idea by introducing the term webhook to this. I also see no reason you would want to include a third-party like Integromat to the proceedings.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 philnash