I am sending an email from my SAP System to gmail. The body is html and javascript based content. Now, the requirement is to create a new url window onclick of a button or a link inside the email which will open a web page in a popup window.
So, when i am testing it within SAP, it is working correctly but when i am testing it within the gmail application, it is calling the URL in a new Tab(Full Page). As it is just an informational window, i want to keep it as small as possible.
Here is my code for the email content
<!DOCTYPE html>
<html>
<body>
<script type="text/javascript">function target_popup(form){
window.open("","formpopup","width=3000,height=40,resizable,scrollbars");
form.target="formpopup";}
</script>
<form action="https://testapp.html" onsubmit="target_popup(this)">
<input type="submit" value="Go to Google" />
</form>
</body>
</html>
All email clients have (and must have) a strict policy against running any Javascript found in emails.
This is a strong security requirement, you will not get around it. Which is good. You can only place Javascript on the target site, not in the email.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With