Search for the Article

Trigger email when a new entry appear on sheet


Here is the code 

Step 1: Paste below code in app script 
Step 2: Save it, Run it and Deploy it as a new development. 
Step 3: Go to triggers and create a new trigger and assign trigger values 
Make sure the function onChange is bound to the onChange trigger and the event source is selected as From Spreadsheet.


 
  


function onChange(e) {
  // Get the active sheet
  var sheet = SpreadsheetApp.getActiveSheet();

  // Get the active cell
  var activeCell = SpreadsheetApp.getActiveRange().getA1Notation();

  // Get the email address to send the notification to
  var emailAddress = "example@email.com";

  // Compose the message and subject of the email
  var message = "The sheet " + sheet.getName() + " has been updated.";
  var subject = "Google Sheet Update Notification";

  // Send the email notification
  MailApp.sendEmail(emailAddress, subject, message);
}