I have created a link "click here to reopen the incident" on Email script but it should be button not link on email. can any one help me.

SP22
Mega Sage
Mega Sage

I have created a link "click here to reopen the incident" on Email script but it should be button not link on email. can any one help me where i am missing the point in below script.

(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
    /* Optional EmailOutbound */
    email, /* Optional GlideRecord */ email_action,
    /* Optional GlideRecord */
    event) {

    var url = '<a href="mailto:' + gs.getProperty('glide.email.reopen.incident') + '?subject=Re: Please reopen' + current.number + '&amp;body=You can type a message before this text. Please do not edit the Subject or remove the following text: , or the record will not reopen%0D%0A' + email.watermark + '">' + 'click here to reopen the incident' + '</a>';
    template.print(url);


})(current, template, email, email_action, event);

 

find_real_file.png

Thanks

SP

1 ACCEPTED SOLUTION

Hello, 

It should be like this:

var url = '<a href="mailto:' + gs.getProperty('glide.email.reopen.incident') + '?subject=Re: Please reopen' + current.number + '&amp;body=You can type a message before this text.

Please do not edit the Subject or remove the following text: , or the record will not reopen%0D%0A' + email.watermark + '"><img src=\"PIC.jpgx\" /></a>';

 

Best regards,
Boyan

View solution in original post

13 REPLIES 13

Hello, 

Have you uploaded the picture that you will use in db_image?

Best regards,

Boyan

yes uploaded the picture in the db_image. I am able to see it in preview notification and on incident form and i am not able to see it on outlook email.

I want to know what are the images supporte by outlook from servicenow.

If you use jpg or jpgx it will go. Below, there is screenshot of notification that is implemented like this.

find_real_file.png

Best regards,

Boyan

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

Check this blog on how to add buttons in email body

Approve/Reject button in Approval notification

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

shloke04
Kilo Patron

Hi,

You can make use of existing functionality which already exist on the platform. If you look at OOB notification name "Incident Resolved" it displays aa button which you are looking for.

URL for the Notification :

https://instance.service-now.com/nav_to.do?uri=sysevent_email_action.do?sys_id=498162a20a0a0b4b00725fb9e5b6aeb3%26sysparm_view=advanced

Replace "instance' with your instance name.

find_real_file.png

Now if you want to do this for any of your Custom Notification then please follow the steps below:

1) There is a OOB Email Script which is available named "incident_take_me_to_the_incident". You just need to call it in your Notification where you want like below:

${mail_script:incident_take_me_to_the_incident}

Adding this line to the body of the Notification will add the button and you don't have to write any custom script here.

find_real_file.png

 

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke