How do I customize the email sent by the OTP Email Sender node in AM (All versions)?
The purpose of this article is to provide information on customizing the text in the OTP email sent by the OTP Email Sender authentication node in AM. The OTP Email Sender node sends an email containing a generated one-time password to the user.
Background information
The OTP email template is Plain Text. You can make simple changes to the content of the OTP email by editing the OneTimePasswordSmtpSenderNode.properties file, which is located in the auth-nodes-<version>.jar file in the WEB-INF/lib directory of the AM WAR file. You can find this file in the following path within the jar file: org/forgerock/openam/auth/nodes.
If you want more extensive changes that require HTML or Rich Text formatting, you will need to create a custom SMS Gateway Implementation Class, specify a different content type in the custom.java file and update the OTP Email Sender node configuration to specify the Gateway Implementation class you are using. See Node development (AM 6.5 and later) or How do I customize authentication tree nodes using source code in AM 6.0.x? for further information on customizing nodes.
Note
Creating and using a custom SMS Gateway Implementation class is outside the scope of ForgeRock support; if you want more tailored advice, consider engaging Deployment Support Services.
Changing the OTP email content
You can update the OTP email subject and body as follows:
- Unpack the AM WAR file and extract the auth-nodes-<version>.jar file from the WEB-INF/lib directory.
- Navigate to the org/forgerock/openam/auth/nodes path within the extracted jar.
- Edit the OneTimePasswordSmtpSenderNode.properties file and change the following properties as required to update the email subject and body:messageSubject=One Time Password messageContent=Your One Time Password:
- Repack the auth-nodes-<version>.jar with your changes.
- Add your customization to the AM WAR file:
- Replace the existing jar file in the WEB-INF/lib directory with your customized jar file.
- Repack the AM WAR file and deploy as normal.
- Restart the web application container in which AM runs.
- Test your changes.
See Also
Related Training
N/A
Related Issue Tracker IDs
N/A