Add watermark to subject in Email Client Template

jeff_xing
Giga Contributor

Hello guys,

I need add the watermark in Subject, I tried add the code "${subject_watermark}" or "${mail_script: subject_watermark}" in it, but not work. Show them as below.

find_real_file.png

I need let the watermark show as below image, I marked it by red box.

find_real_file.png

Could anyone help me or give me some advice? Much appreciate for your help! Thank you in advance!

1 ACCEPTED SOLUTION

samye
Tera Contributor

Hi Zhifei



Try to create a business rule for sys_mail table




Condition: current.type.changesTo('send-ready')





function onBefore(current, previous) {


     


      var gr = new GlideRecord('sys_watermark');


      // gr.addQuery('number', 'MSG0008730');


      var email_id = current.sys_id;


      gr.addQuery('email', email_id);


      gr.query();


      if (gr.next())


              {


              current.subject = current.subject + "Ref:" + gr.number;


      }


     


}


View solution in original post

4 REPLIES 4

Govind Kumar S1
Kilo Guru

Hi Zhifei xing,



Below thread has exactly same requirement as yours..Please read it


Retrieving the watermark reference # from mail_script



Thanks & Regards,


Govind Kumar Sharma



** mark Correct/helpful based upon impact of response**


Jim Coyne
Kilo Patron

Jim Pisello's response to you in the other thread (Re: Retrieving the watermark reference # from mail_script ) would definitely work, but I guess the real question is why do you need the watermark in the subject line in the first place?


Hello,


Thank you for your reply, I need the watermark in subject line because if Service now email to the one out of office,   Service now would receive a auto responder email, auto responder email body was deleted and the email without the watermark. If I add the watermark in subject where I marked, the auto reply would has the watermark info, we can also add the watermark in the body part, but still not found the correct code. Could you pls help me, tell me the right way add the code in subject or body part? I tried some methods, but always not work. Could you pls show me some example code or screen shots? Much appreciate your help!


samye
Tera Contributor

Hi Zhifei



Try to create a business rule for sys_mail table




Condition: current.type.changesTo('send-ready')





function onBefore(current, previous) {


     


      var gr = new GlideRecord('sys_watermark');


      // gr.addQuery('number', 'MSG0008730');


      var email_id = current.sys_id;


      gr.addQuery('email', email_id);


      gr.query();


      if (gr.next())


              {


              current.subject = current.subject + "Ref:" + gr.number;


      }


     


}