Mail script/html - how to add a thick line to separate sections

Sandy7
Tera Expert

Hi, I appreciate everyone responding to my questions. I have another html / mail script question. I would like to add a thick line to cleanly separate different sections of the report. I can't seem to get it to work. 

 Thanks!

This is part of the code I am using to populate the email -

 

       baseUrl = gs.getProperty("glide.servlet.uri");

 

       var gr = new GlideRecord("incident");

 

       gr.addEncodedQuery("priorityIN1,2^u_resolvedRELATIVEGE@hour@ago@24^NQpriorityIN1,2^incident_stateIN1,2,3,4");

 

      gr.orderBy('sys_created_on');

 

       gr.query();

   

if (gr.hasNext()) {

 

    template.print('<p><font size="18" face="arial">Major Incidents');

    template.print("<table style=\" text-align: left;background-color: F2F3F3;border-collapse: collapse;font-family: arial, helevetica, sans-serif;font-size: 12pt; padding: 5px;border: 1px solid; border-color: grey;\">");

    template.print("<tr><td style=\"padding: 5px; border: 1px solid; border-color: grey;\" >");

    template.print('Number');

    template.print("</td><td style=\"padding: 5px; border: 1px solid; border-color: grey;\" >");

    template.print('Priority');

    template.print("</td><td style=\"padding: 5px; border: 1px solid; border-color: grey;\" >");

    template.print('Incident State');

    template.print("</td><td style=\"padding: 5px; border: 1px solid; border-color: grey;\" >");

    template.print('Short Description');

              template.print("</td><td style=\"padding: 5px; border: 1px solid; border-color: grey;\" >");

              template.print('Date/Time Opened');

 

             

    template.print("</td></tr>");

   

    template.print("</td></tr>");

   

    while (gr.next()) {

    template.print("<tr><td style=\"padding: 5px; border: 1px solid; border-color: grey;\">");

    template.print("<a href='" + baseUrl + gr.getLink() + "'>" + gr.getValue('number') + "</a>");

    template.print("</td><td style=\"padding: 5px; border: 1px solid; border-color: grey;\">");

    template.print(gr.priority);

    template.print("</td><td style=\"padding: 5px; border: 1px solid; border-color: grey;\">");

    template.print(gr.getDisplayValue('incident_state'));

    template.print("</td><td style=\"padding: 5px; border: 1px solid; border-color: grey;\">");

    template.print(gr.short_description);

              template.print("</td><td style=\"padding: 5px; border: 1px solid; border-color: grey;\">");

              template.print(gr.getDisplayValue('opened_at'));

 

    template.print("</tr style=\"text-align:right;\">");

    template.print("<tr><td colspan=\"5\"style=\"padding: 5px; border: 1px solid; border-color: grey;\" >");

    template.print('Business Impact:' + gr.u_incident_business_impact);

   

    }

   

    template.print("</td></tr>");

    template.print("</table>");

    }

    else{

                            

                            

        template.print('<p><br><font size="16" face="arial">Major Incidents</br>');

             

        template.print('<p><br><font size="11" face="arial">No Major Incident</br>');

                            

    }

3 REPLIES 3

sachin_namjoshi
Kilo Patron
Kilo Patron

Activate "Newlines to HTML" in notification email script and then can use "template.print("<br />") 

 

find_real_file.png

 

Regards,

Sachin

 

 

Ashutosh Munot1
Kilo Patron
Kilo Patron

Hi,

find_real_file.png


This is your report right, in between two rows you want to add thick line?

Thanks,
Ashutosh

Jaspal Singh
Mega Patron
Mega Patron

Each of lines with code as below in your script before while loop (total of 5 lines)

   template.print("<tr><td style=\"padding: 5px; border: 1px solid; border-color: grey;\" >");

needs to be replaced with

   template.print("<tr><td style=\"padding: 5px; border: 5px solid; border-color: grey;\" >");

 

with output as below.

find_real_file.png