Reputation: 81
What I need is I want to fetch an API using a button. I have created html template in sendgrid dynamic template from preview its working perfectly. But email the invisible.
After that I have removed button and check with anchor tag same issue not working.
email body its appearing but cannot click or do anything
But in the html template all are working fine and APIs are fetching perfectly
Upvotes: 0
Views: 895
Reputation: 73075
I regret to inform you that email clients block JavaScript from executing, so this cannot work.
You should make your unsubscribe button link to a page on your site in which your user can unsubscribe.
There are some circumstances in which you can run (sort of) JavaScript in some email clients. There is a framework called AMP4Email which allows you to use web components with extra behaviour within an email, you can read an introduction to sending AMP emails here.
Upvotes: 2