There is a potential, but very roundabout way it might be achieved completely dynamically, but I don't like it. First, I don't believe client-side javascript may be embedded in an email at all. We do not support server-side template page scripting either for the email_message.xml file. That said, we do support HTML email, so the template page could look something like this:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<Subject>
<Value>
One-time Password
</Value>
</Subject>
<Message>
<Value>
<html>
This is your new <b>HTML</b> one-time password @OTP_STRING@.
Thank you,
OTP Test
<div>
<img src="https://someserver.com/url/that/generates/an/image/that/looks/like/the/text/you/want" />
</div>
</html>
</Value>
</Message>
</root>
Incredibly hokey, and might not work, plus getting an email client to always show embedded images in HTML emails has been hit and miss in my experience.
I think a better and easier approach, if its just the year or other limited-list static data you want to have different, would be to pre-create a bunch of static-content email delivery template pages with the values prepopulated, then put a JS InfoMap in your custom AAC authentication policy before that MacOTP mechanism that sets a context attribute to decide which one to use, then update the MacOTP mechanism configuration properties within that policy to use the page template file from the context attribute (rather than the default of /<lang>/otp/delivery/email_message.xml. If though your JS was just representative, and its not just the year you wanted to dynamically populate, then no, you can't do that in an email message.
A final idea, which is better than any of the others but won't help you now, would be to raise an RFE to allow a custom macro value to exist in the page template, where you populate that custom macro's text value in an InfoMap preceding the MacOTP mechanism. Again, that won't help you now, but might be useful to both you and others in future.
------------------------------
Shane Weeden
IBM
------------------------------
Original Message:
Sent: Wed September 18, 2024 04:10 AM
From: Gomathy Sethusankar
Subject: ISVA 10.0.4 Customize Email OTP Template query
Hi Team ,
I am trying to customize the Email OTP template which is available in AAC-->Template files --> /otp/delivery/email_message.html I wanted to add a footer in the OTP email for the customer which should automatically update the current year .
I am trying to add the below JavaScript , but I am not getting the year i the email .
<script type="text/javascript">document.write(new Date().getFullYear());</script>
Is JavaScript supported for the Email OTP template of ISVA 10.0.4 ? Please clarify
Thanks and Regards,
Gomathy Sethusankar
Security Consultant
Managed Security Services
Mobile: +91-9901508141
gsethusa@in.ibm.com
IBM Security