How to get Subject in email template body

ryancox
Giga Contributor

Is it possible to get the Subject of a notification to be used in the body of a template?

I am trying to use templates more often and I would be helpful if I could pull the subject from the notification that is using the template into the body of the email.

Make sense?

1 ACCEPTED SOLUTION

Hmmm, interesting one, I tried the above one but did not work so I explored the more options and came out with solution.


Put the below code where you want the subject to be printed inside the body of the notification email template.



<mail_script>


template.print(email.getSubject());


</mail_script>


View solution in original post

6 REPLIES 6

Ravi Prasad1
Tera Guru

Question is not clear. Can you please explain more.


ryancox
Giga Contributor

When you are defining a notification that is using a template and you set up a subject on that notification, I want to use that Subject in the template so that I can pull it into the   body of the sent email.


Weird guess , but can you try something like below in <mail_script> tag



<mail_script>


template.print(sys_email.subject)


</mail_script>


Hmmm, interesting one, I tried the above one but did not work so I explored the more options and came out with solution.


Put the below code where you want the subject to be printed inside the body of the notification email template.



<mail_script>


template.print(email.getSubject());


</mail_script>