mailto link with both Watermark and Custom Body Text

G24
Kilo Sage

Hello smart people,

 

When one of our HR Cases needs to be approved by a manager, we send out an email that includes the following in the message HTML:

 ${mailto:mailto.approval.hr_case}

 

...clicking on this link will automatically draft an email for the manager, to be sent back to ServiceNow indicating his approval.  When the user clicks on that link, an email is composed with the following subject and watermark:

Subject
     Re:HRC0015443 - approve
Watermark
     Ref:MSG8210004_FThoSGHEsa9jVaJb4kb7

 

But the BODY of the email is blank. And I don't see a way of adding text to the body of the email by modifying sysevent_email_template "mailto.approval.hr_case"

 

I tried adding an "Email layout" to the record, and that also did not work.

 

As an alternative approach, Approach 2, I tried constructing my own "mailto" tag in the body of the HTML, as follows:

 

<a href="mailto:${mail_script:chs_get_sys_prop__sn_hr_core.hr_email}?subject=RE: ${sysapproval} - approve&amp;body=Sending%20this%20email%20will%20cause%20the%20CHS%20Solutions%20Portal%20to%20record%20your%20approval%20for%20request%20${document_id.number}.">Approve instantly via Email</a>

 

...And this works in that it does compose an email draft with the body that I want, however it does not include the necessary watermark, and there seems to be no way to manually generate a watermark like the one that ServiceNow is automatically including via the mail "template".  So this approach is not working when the message gets back to ServiceNow.  (ServiceNow relates the email with the case and not with an approval.)

 

Does anyone know how I can have a link which drafts an approval email back to ServiceNow that includes BOTH custom body text AND a Watermark?  Thanks.

 

Details...

Approach 1 screenshot:

111.png

 

Approach 1 email draft screenshot:

000.png

 

Approach 2 screenshot:

<a href="mailto:${mail_script:chs_get_sys_prop__sn_hr_core.hr_email}?subject=RE: ${sysapproval} - approve&amp;body=Sending%20this%20email%20will%20cause%20the%20CHS%20Solutions%20Portal%20to%20record%20your%20approval%20for%20request%20${document_id.number}.">Approve instantly via Email</a>

  - Resulting email draft will not include necessary watermark.  : (

7 REPLIES 7

GlideFather
Tera Patron

Hi @G24,

every single Watermark is stored in the [sys_watermark] table. So you could create onBefore business rule, that would add that desired string before storing the watermark into the particular table, if you set the conditions right it shall not have any performance impact either...

Let me know what do you think about this approach?

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */


Another idea: the email templates have 3 fields with similar name: Message, Message HTML, Message Text.
Try to populate the same content in all of them, or just and only one to see if there is any difference

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */


Those fields cause content to go into the Notification, but not into the actual mailto HTML tag that is rendered (and thus not into the draft email).

because the OOTB email templates have populated EITHER one, never both at the same time..

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */