'How to add Event Listener like "onclick method" to a button that will be rendered in an Email Template and Send to User Gmail using nodemail
I have a custom Email Template for my project. I am sending this template using nodemailer to the user's Gmail account. What I want to do is to add an event listener to the buttons that I have added inside the template. I want to perform some database queries when the user clicks any of the buttons.
Solution 1:[1]
- emails do not support javascript, so an on-click event is impossible in an email
- this does not mean that you cannot setup links and add
<a href="#" />tags in your email template with prebuilt url's and setup a server to respond to the href
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 | alilland |
