How to set Watermark link in Email body for custom table notifications

suresh40
Tera Contributor

Hi All,

 

My requirement is how set  Watermark link in email body  for custom table notifications.

We have some external vendors we are trying to interact with from Service-now using email and email responses. 

IN that link we need to Watermark link beside CBA number its is possible add watermark in that link. please help me on this.

Thanks

Suresh

 

suresh40_0-1669812121833.png

2 REPLIES 2

David Whaley
Mega Sage

Hi Suresh,

 

If I understand correctly you need to query the sys_watermark in your mail script for the CBA record and get the REF: MSG number from there. 

 

I have an article here One daily email reminder that contains all approvals that builds a mailto: link for approvals but you can still use it as a guide to get the watermark in the link so it is put into the body of the email when your vendor clicks it.

 

Example:  In a mail script get the watermark msg number this will need to be modified to query the CBA record

 

//Approval or Reject Links
	var msg = new GlideRecord('sys_watermark');
		msg.addEncodedQuery('source_id='+ app.sys_id);
		msg.query();
	var number = '';
	if(msg.next()) {
		number = msg.number;
	}

 

 Example: Then to build your link (this puts it in the body but can be modified to put it next to your CBA number).

 

mailto = 'mailto:' + gs.getProperty("glide.email.user");
var approve = mailto + '?subject=RE:%20' + app.getDisplayValue('sysapproval') + '%20-%20approve&body=%0D%0A%0D%0A%0D%0ARef%3A' + number;

 

 

Ivar Donado
Mega Sage

It doesn't work. By the time the notification email script runs, the watermark record hasn't been created yet.