Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Need help on email notification formatting issue.

Keang
Tera Contributor

Hello,

I have been struggling with the email notification format and hope someone can provide some assistance.

 

The notification contains Start and End text along with email scripts.

Keang_1-1697648002053.png

 

However, when it prints, the dates are showing below the 'Start' and 'End' text. I couldn't figure out why it does that. Please help. Thank you.

 

Keang_0-1697647815723.png

 

7 REPLIES 7

Anand Kumar P
Giga Patron

Hi @Keang ,

Use break template.print("<br /> <br />"); in your email script.

Thanks,

Anand

Hi @Anand Kumar P 

Thank you for helping.  Please let me know where I need to enter the break in the following code?

 

//Print Start Date
var requiredDate = dayName + ', ' + monthName + ' ' + day + '. ' + year + ' at ' + strTime;
template.print(requiredDate);

Hi @Keang ,

// Print Start Date
var requiredDate = dayName + ', ' + monthName + ' ' + day + '. ' + year + ' at ' + strTime;
template.print(requiredDate + '<br>');

Thanks,

Anand

Keang
Tera Contributor

@Anand Kumar P 

This is the HTML code:

 

<p style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;"><span style="font-size: 12pt; font-family: Lato, sans-serif; color: black;">Start:</span><strong><span style="font-size: 12pt; font-family: Lato, sans-serif; color: black;">&nbsp; ${mail_script:IT_Notification_startDate}</span></strong></p>

 

Please help.  Thank you