Why after calling email script in notification next word goes into next line?

Prathamesh Cha1
Tera Contributor

Hi All,

Why after calling email script in notification next word goes into next line?

as you can see in below screenshot

 

 

PrathameshCha1_1-1698836707409.png

 

PrathameshCha1_2-1698836734361.png

 

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

          // Add your code here

          //var link = current.getLink();

         // var link = 'https://shldev.service-now.com/esc?id=hrm_ticket_page&sys_id=' + current.sys_id + ' &table=sn_hr_core_case_total_rewards' ;

        var link = 'https://shldev.service-now.com/esc?id=hrm_ticket_page&sys_id=' + current.sys_id + ' &table=' + current.getTableName()
   
    template.print('<font face="helvetica">');
   
    var backgroundColor = 'background-color: #FFFFFF;';
    var border = 'border: 1px solid #FFFFFF;';
    var color = 'color: #0000FF;';
    var fontSize = 'font-size: 16px;';
    var fontFamily = 'font-family: Helvetica, Arial, sans-serif;';
    var textDecoration = 'text-decoration: none; border-radius: 3px;';
    var webKitBorder = '-webkit-border-radius: 3px;';
    var mozBorder = '-moz-border-radius: 3px;';
    var display = 'display: inline-block;';
    var padding = 'padding: 5px;';
   
    if (email_action.name == "Incident Survey") {
        color = 'color: #343d47;';
        backgroundColor = 'background-color: #e6e8ea;';
        border = 'border: 1px solid #bdc0c4;';
    }
    template.print('<a href="' + link + '"');
    template.print('style="' + backgroundColor + border + color + fontSize + fontFamily + textDecoration + webKitBorder + mozBorder + display + padding);
    template.print('">');
    template.print(gs.getMessage(current.number));
    template.print('</a>');
    template.print('</font>');
    template.print('<br><br>');


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

 

1 ACCEPTED SOLUTION

Hi @Prathamesh Cha1 

 

Can you try removing below line from mail script & check : 

 

  template.print('<br><br>');

 

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates

View solution in original post

5 REPLIES 5

Vishal Birajdar
Giga Sage

Hi @Prathamesh Cha1 , 

 

If possible can you please share screenshot of mail script...!!!

 

 

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates

HI @Vishal Birajdar ,

 

Please check I have edited my og post

Hi @Prathamesh Cha1 

 

Can you try removing below line from mail script & check : 

 

  template.print('<br><br>');

 

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates

SANDEEP28
Mega Sage

@Prathamesh Cha1 Put the email script within <span> tag in notification record using source code. By default it takes <div> tag I guess.

 

If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!