TriggerShelf

Recipe

Send an email when a checkbox is ticked in Google Sheets

Trigger: Installable on-editServices: SpreadsheetApp, MailAppMock-tested: Nov 2026

Tick the box in column H and the row's columns A to E are emailed to the address in column F. Column I gets a timestamp, so the same row never sends twice.

Set it up

  1. Open the sheet, then Extensions > Apps Script. Paste the script and save.
  2. Change CFG at the top if your columns differ from the layout above the code.
  3. Click Triggers (clock icon) > Add trigger. Choose onCheckboxEdit, From spreadsheet, On edit. Approve the permission prompt.

The script

/**
 * Email a row when its checkbox is ticked.
 * Layout: A-E data, F recipient email, H checkbox, I "Sent at" stamp. Row 1 = headers.
 * Trigger: installable On edit trigger for onCheckboxEdit.
 */
var CFG = { sheetName: 'Sheet1', checkboxCol: 8, emailCol: 6, sentCol: 9, firstDataCol: 1, lastDataCol: 5 };

function onCheckboxEdit(e) {
  if (!e || !e.range) return 'skip:no-event';
  var range = e.range;
  var sheet = range.getSheet();
  if (sheet.getName() !== CFG.sheetName) return 'skip:sheet';
  if (range.getColumn() !== CFG.checkboxCol || range.getRow() < 2) return 'skip:cell';
  if (e.value !== 'TRUE') return 'skip:unchecked';
  var row = range.getRow();
  if (sheet.getRange(row, CFG.sentCol).getValue()) return 'skip:already-sent';
  var width = CFG.lastDataCol - CFG.firstDataCol + 1;
  var headers = sheet.getRange(1, CFG.firstDataCol, 1, width).getValues()[0];
  var values = sheet.getRange(row, CFG.firstDataCol, 1, width).getValues()[0];
  var to = String(sheet.getRange(row, CFG.emailCol).getValue()).trim();
  if (!/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(to)) return 'skip:bad-email';
  var body = headers.map(function (h, i) { return h + ': ' + values[i]; }).join('\n');
  MailApp.sendEmail(to, 'Row ' + row + ' update', body);
  sheet.getRange(row, CFG.sentCol).setValue(new Date());
  return 'sent';
}
Test status. 6 of 6 automated checks pass, run Nov 2026 against simulated Google services. This recipe has not yet been run inside a live Google account. Test it on a copy of your sheet first.

What you should see

NameTaskDueEmailSend?Sent at
AnaInvoiceNov 20ana@example.comTRUE2026-11-14 10:02
BenReportNov 21ben@example.comFALSE

After ticking H2: the row is emailed and I2 is stamped. Sample values, not output from a real account.

Common errors and fixes

Exception: You do not have permission to call MailApp.sendEmail
A simple onEdit trigger cannot send mail. Use the installable trigger from step 3, and do not name the function onEdit.
The email sends twice
Column I must stay filled after a send. Clearing it re-arms the row.
Nothing happens when I tick the box
The trigger is missing, or sheetName in CFG does not match the tab name.

Permissions. Running this script asks you to grant Google permissions for the services listed above, to your own script. TriggerShelf never receives your Google data. See the permissions table. Google will show "Google hasn't verified this app"; that is expected for a script you paste yourself.