I need assistance with iterating through a JavaScript object where each key:value pair is displayed on separate lines in the email body using Appscript. I believe it might need to be converted to an HTML string but I'm not entirely sure. The code snippet I currently have is as follows:
let data = {}
const information = dataRange.filter(function(row) {
return row[0] >= result && row[10] != 'Gratitude' && row[10] != 'Notes' && row[10] != ''
}).map(function(row) {
return data[row[0]] = row[10]
})
var message = {
to: '<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a0d0c5d2d3cfce91e0c7cdc1c9cc8ec3cfcd">[email protected]</a>',
subject: 'Weekly Summary',
body:
`
This week's summary:
${data}`,
}
MailApp.sendEmail(message);
Any guidance would be highly appreciated.
Thank you!