質問: true){ MailApp.sendEmail(recipients[person], subject, body); } };
回答: ``` function onEdit(e) { const sheet = e.range.getSheet(); const r = e.range.getRow(); //const c = e.range.getColumn(); const person = sheet.getRange(r, 1).getValue(); const recipients = {}; const to = recipients[person]; if(!to) return; const spreadsheet = e.source; const a1note = e.range.getA1Notation(); const subject = "【更新】"+spreadsheet.getName(); const body = [person+"の行が更新されました",spreadsheet.getUrl(),"更新対象は"+a1note.replace(/¥d+/,"")+"列です"].join("¥n"); MailApp.sendEmail(to, subject, body); } ```