Help

Save the date! Join us on October 16 for our Product Ops launch event. Register here.

Formatting in Outlook emails

Topic Labels: Scripting
757 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Matthew_Moran
7 - App Architect
7 - App Architect

I create some summary reports for a client. Data is read from a view I iterate through the records to generate the HTML/Markdown for the email.

However, to get the formatting correct, I have to use this odd amalgamation of markdown and HTML. Using one or the other alone results in unpredictable results. When using markdown to create the 2nd or 3rd level header worked on the first record. Each subsequent record simply had the "## " in the email.

Also, I can't use markdown or HTML to get a horizontal rule... annoying. Any answers for this. Not critical but nice to have.

 

 

for (let i=0;i<recordsLockReady.records.length;i++) {
    let fileString = recordsLockReady.records[i].getCellValueAsString("File").replace(/"/g,'');
    let coeDateString = recordsLockReady.records[i].getCellValueAsString("COE (Estimate)");
    let daysToCOE = "-n/a-";
    if(coeDateString != "") {
        let coeDate = new Date(coeDateString);
        daysToCOE = Math.round((coeDate.getTime() - todayDate.getTime()) / (1000 * 60 * 60 * 24)).toString();
    }
    let fileLink = recordsLockReady.records[i].getCellValueAsString("File_Edit_Link");
    let borrowerString = recordsLockReady.records[i].getCellValueAsString("Borrower").replace(/"/g,'');
    //borrowerString = borrowerString.replace("\"",'');
    let rate = recordsLockReady.records[i].getCellValueAsString("Rate");
    let lenderString = recordsLockReady.records[i].getCellValueAsString("Lender").replace(/"/g,'');

    msgBody += "<h3>Borrower: " + borrowerString + "</3>\n";
    msgBody += "**Lender:** " + lenderString + "<br>"; // + "\n";
    msgBody += "**Est COE:** " + coeDateString + " (lock days needed: " + daysToCOE + ")" + "<br>"; //\n";
    msgBody += "**Initial Disclosure Rate:** " + rate + "<br>"; // + "\n";
    msgBody += "<a href=" + fileLink + ">View File</a>" + "<br>"; 
    msgBody += "######" + "<br><br>"
}

output.set("message",msgBody);

 

The final msgBody += is where I'd like a horizontal rule.

Everything else works peachy. 

Matthew_Moran_0-1690738275413.png

 

0 Replies 0