Email script : HTML syntax for Bold letters

snowuser111
Kilo Guru

Hi,

Can anyone help how can I make the line bold when I write a email script.

My script piece of code looks like this:

_______________________________________________________________________________________

if(compliance)

{

  template.print("\n SOX / PCI compliant request, please Approve / Reject directly in Service Now\n");

}

else

{

  template.print("To approve/reject via email: <br/>");                                                                 // want to make this BOLD

  template.print("Click here to ${mailto:mailto.approval1}<br/>");

  template.print("Click here to ${mailto:mailto.rejection1}<br/>");

}

______________________________________________________________________________________

Thanks

1 ACCEPTED SOLUTION

Community Alums
Not applicable

Include <b> tag inside


View solution in original post

7 REPLIES 7

shristy2
Giga Expert

Hi All,



My Code is like this,and i want to make bold to assigned_to and assignment_group.


If i am incuding the   < b> code inside or outside its showing error.


find_real_file.png



Kindly Help.


add like below

template.print("Comment is <b>bold</b> " + gr.comment);

 

Please mark helpful, if it helps.

Regards

Pawan K Singh

 

Ian Mildon
Tera Guru

Newer HTML syntax is to use <strong> for bold text rather than <b>.

In this example, I am setting a mix of bold and regular text:

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

 template.print("<strong>Device Name:</strong> " + current.ci.getDisplayValue() + "<br/>");
 template.print("<strong>Serial Number:</strong> " + current.serial_number.getDisplayValue() + "<br/>");
 template.print("<strong>Owned by:</strong> " + current.owned_by.getDisplayValue() + "<br/>");
 template.print("<strong>Location:</strong> " + current.location.getDisplayValue() + "<br/>");
 template.print("<strong>Department:</strong> " + current.department.getDisplayValue() + "<br/>");
 template.print("<strong>Floor:</strong> " + current.u_ast_floor.getDisplayValue() + "<br/>");
 template.print("<strong>Room:</strong> " + current.u_ast_room.getDisplayValue() + "<br/>");

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