Is it possible to set the subject of an email client template using an email script?

Sue22
Kilo Contributor

I have created a custom email client template in my pdi which uses the London version.

I would like the subject to be set using an email script.

I am able to set the content of the email client template using the following for example:

template.print('hello world');

However, if I try to set the subject of the email client template using the following code in an email script:

email.setSubject('hello world');

This does not set the subject.

I have checked the system log, the email seems to be returning a value of null (please see attached screengrab).

Does anyone have any suggestions of how I would be able to set the subject using an email script? Or is there a known error that anyone is aware of? It is not an option for me to use the subject field provided in the email client template.

Thanks,

Sue

 

11 REPLIES 11

Sue22
Kilo Contributor

Hi Alexander,

 

I've had another try and am still unable to get this working.

 

Out of interest, how were you able to get it to work? Is your version London?

 

Thanks

 

Sue

Hey Sue,

 

There may be issues on London with emails as well. I would go ahead and send the email and test it to see if the subject shows up. The instances I am currently using are on Madrid and London. It does work when it shows up for me. 

 

The only other thing I can think of is to try a separate script for just the subject and see if it works that way.

Sue22
Kilo Contributor

Hi Alexander,

 

Thanks for your response.

 

I will give it another try and see how I get on.

 

Thanks again and Best wishes,

 

Sue

adriantan08
Giga Expert

We're on Orlando, and I confirm this is not working.

There's no way at all to change the Email Client Subject. 

Very frustrating. 

kevclark
Tera Contributor

This functionality isn't yet available but I found an Idea in the idea portal that could use some upvoting for it - https://community.servicenow.com/community?id=view_idea&sysparm_idea_id=4fd696bddba444100be6a345ca96...