I am sending an email in go which contains html template as it's email content. The html file has a table and a button at the bottom. I have written a script code to handle the click of the button in the email but the script tag seems not being called after the button click. Hence nothing is happening.
This is my html file:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body>
<table bgcolor="#FFFFFF" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
Hello,
</td>
</tr>
<tr>
<td>
You have been assigned a task. Please click on the button below.
</td>
</tr>
<tr>
<td>
<button type="button" id="button">Click me</button>
</td>
</tr>
</table>
<script type="application/javascript">
document.getElementById("button").onclick = function() {
//perform actions on button click
};
</script>
</body>
</html>
These are the header that I am using for sending the email:
header["MIME-Version"] = "1.0"
header["Content-Type"] = ""text/html"; charset=\"utf-8\""
The email is sent and being rendered successfully but the click of the button does nothing. Any help will be highly appreciated.