Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

Email script for email subject

Sandy32
Tera Contributor

Hello,

Can we call email script into email notification subject? Can you please help me with this scenario.

 

Thank you. 

4 REPLIES 4

Maik Skoddow
Tera Patron

Hi @Sandy 

you can find descriptive examples at https://developer.servicenow.com/dev.do#!/learn/courses/rome/app_store_learnv2_automatingapps_rome_a...

The email object provides a method for setting a custom subject: https://developer.servicenow.com/dev.do#!/reference/api/rome/server/no-namespace/c_GlideEmailOutboun...

And you call that email script within the body field of your email notification.

Let me know, if you have any further questions.

Kind regards
Maik

Sulabh Garg
ServiceNow Employee

Hello Sandy,

Instead calling email script from email notification subject, you can plan to set subject through email script.

e.g below

email.subject = 'My subject

 

Please Mark Correct/helpful, if applicable, Thanks!! 

Regards

Sulabh Garg

Please Mark Correct/helpful, if applicable, Thanks!!
Regards
Sulabh Garg

Hello Sulabh,

It means, in email script need to use syntax email.subject and then call it in email notification body via email script syntax??

Sulabh Garg
ServiceNow Employee

That is right...Exactly..

 

Please Mark Correct/helpful, if applicable, Thanks!! 

Regards

Sulabh Garg

Please Mark Correct/helpful, if applicable, Thanks!!
Regards
Sulabh Garg