Subscription Emails: How to Customize Subject Line Sent Out Via Email?
- May 3, 2024
- 1 reply
- 4629 views
Version: Windchill 12.0
Use Case: I have a case where I need to be able to control the Subject Line that is displayed in the email notifications triggered by a Subscription. Running a WC 12.0.2.X system.
Description:
When creating a Subscription, on page 3 (Define Subject and Expiration), the user can input any text they want as the Subject of the Subscription.
Therefore, when an email is sent, the Subject Line of the email is the characters inputted in the Subject.
I need to be able to still allow users to input whatever subject line they want in the Subject field so that it is still visible in Windchill.
But, I want to change the Subject Line that is displayed in the Emails.
For workflows, this was fairly simple.
I added the following script to the General.html file between the <html> and <head> tags:
<SCRIPT language=Windchill> <!-- beginSubject --> </SCRIPT>
<SCRIPT language=Windchill> <!-- getInitSubject --> </SCRIPT>
<SCRIPT language=Windchill> <!-- getProcessName --> </SCRIPT>
<SCRIPT language=Windchill> <!-- addText text=" - " --> </SCRIPT>
<SCRIPT language=Windchill> <!-- getActivityName --> </SCRIPT>
<SCRIPT language=Windchill> <!-- endSubject --> </SCRIPT>
For Subscriptions, the Subject Line in Emails seems to be coming from a Java class, and therefore adding that script to the subscriptionNotification.html file does not work. (It causes a blank email to be sent with no change to the Subject Line)
Does anyone have any advice or experience with customizing the Subject Line displayed in Subscription Emails?
As seen in the attached image, I want to change the subject line in the red box.




