function triggerOnChange(event) { {
var colChanged = event.range.getColumn(E);
var rowChanged = event.range.getRow();
var newValue = event.value;
if (colChanged == 5 && newValue == "TRUE")
{
sendtheEmail(rowChanged)
}
}
function sendtheEmail(_rowChanged) {
// get data
var sheet = SpreadsheetApp.getActiveSheet('All potential sponsors');
var lastCol = sheet.getLastColumn();
var rowData = sheet.getRange(_rowChanged,1,1,lastCol).getValues()[0];
const emailAddr = SpreadsheetApp.getActiveSheet('key').getRange(C4)
const eventRequested = rowData[]
// create subject line
const subjectLine = 'Sponsor requesting an invoice'
// create email body
const htmlBody = '<br>' + 'Hi HighLord,' + '<br>' + 'eventRequested' + 'has offered to sponsor us and is requesting an invoice. Can you please reveiw and provide them with one.' +'<br>'
// send email
GmailApp.sendEmail(emailAddr,subjectLine,{htmlBody: htmlBody});
}