So I am declaring a string as var in single quotation and I want to have this string be multiple lines, I tried using \n , \r , and
but non of them worked.
Note that the string declared later as const body is working just fine.
import {sendEmail, sendEmailWithRecipient} from 'backend/email';
$w.onReady(function () {
$w("#dataset2").onAfterSave(sendFormData);
});
function sendFormData() {
if ($w("#dropdown1").value === 'Accepted') {
var Letter = 'line <br> line';
} else {
var Letter = ' line <br> line';
}
const subject = `Application Update`;
const body = `
\rDear ${$w("#dropdown1").value}
\r ${Letter}
\rSincerely,
\ryours`;
const recipient = $w("#dropdown2").value;
sendEmailWithRecipient(subject, body, recipient)
.then(response => console.log(response));
}