We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

adding html tags in mail script

Renu4
Tera Contributor

Hi Everyone,

I need to make the text in Short Description as bold in this mail script. I tried <b> and <stong >tags but nothis seems to be changing .

 

(function runMailScript(current, template, email, email_action, event) {

    if (current.getTableName() == 'task_sla') {
        template.print('<div><p class="sub2heading strong">Additional Details:</p>');
        template.print('<p class="normal">Caller: ' + current.task.caller_id.getDisplayValue() + '</p>');
        template.print('<p class="normal">Email: ' + current.task.caller_id.email + '</p>');
        template.print('<p class="normal">Phone: ' + current.task.caller_id.phone + '</p>');
        template.print('<p class="normal">Mobile: ' + current.task.caller_id.mobile_phone + '</p>');
        template.print('<p class="normal">Short description: ' + current.task.short_description + '</p>');
        template.print('<p class="normal">Description: ' + current.task.description + '</p>');

 BR,

Renu.

2 ACCEPTED SOLUTIONS

Anand Kumar P
Tera Patron

Hi @Renu4 ,

Check you tried in this way

template.print('<p class="normal">Short description: <strong>' + current.task.short_description + '</strong></p>');
    

Please mark it as solution proposed and helpful if it serves your purpose.

Thanks,

Anand

View solution in original post

Ankur Bawiskar
Tera Patron

@Renu4 

try this

template.print('<p class="normal">Short description: ' + '<b>' + current.task.short_description + '</b></p>');

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

3 REPLIES 3

Anand Kumar P
Tera Patron

Hi @Renu4 ,

Check you tried in this way

template.print('<p class="normal">Short description: <strong>' + current.task.short_description + '</strong></p>');
    

Please mark it as solution proposed and helpful if it serves your purpose.

Thanks,

Anand

Ankur Bawiskar
Tera Patron

@Renu4 

try this

template.print('<p class="normal">Short description: ' + '<b>' + current.task.short_description + '</b></p>');

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Renu4
Tera Contributor

Thank you Anand it works.