email script

nameisnani
Mega Sage

Hi Team , 

 

can anyone please help me in the , mail script 

 

I want print for a specific catalog item variables in the notification .

 

i have written mail script for this 

nameisnani_0-1718851759489.png

 

Please correct if there is any mistake in notification configuration 

nameisnani_1-1718851827091.png

nameisnani_2-1718851894335.png

 

Preview is showing like this 

nameisnani_3-1718852051220.png

 

Catalog Item variables 

nameisnani_4-1718852178025.png

 

 

 

OUTPUT has to come like this 

 

SUB :- Short desciption 

 

Body

"A lost or stolen device has been reported by" <Requested For>
The device was lost or stolen on <Date item was Lost/Stolen>
[Blank Line]
"Description:"
<Description>

 

 

can anyone please help me here .

 

what was the mistake .

 

thanks

8 REPLIES 8

dhanrajb
Tera Guru

Hi @nameisnani ,

 

I see there is a space in your HTML body, which is causing the issue (email script does not exist). Try without space like this ''${mail_script:after_line_manager_approval}.

 

Regards,

Dhanraj

@dhanrajb 

nameisnani_0-1718856521778.png

 

nameisnani_1-1718856550838.png

 

 

Try the below script and make sure all the backend value of the variables are correct. I'm not sure where you defined your description value.

 

var requester = current.requested_for.getDisplayValue();
var date = current.variables.date_item_was_lost_stolen;
template.print('A lost or stolen device has been reported by '+requester+' \n The device was lost or stolen on '+ date+' \n \n Description:<Description>');

 

Regards,

Dhanraj.

SN_Learn
Kilo Patron
Kilo Patron

Hi @nameisnani ,

 

The error is coming up because of the span tag.

In order to fix this please follow the steps mentioned in below post:

 

Email script render error 

 

Mark this as Helpful / Accept the Solution if this clears your issue

----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.