Ever wished your spreadsheet could send an email when a specific value is entered — like a status change to “APPROVED” or when a task is marked “URGENT”? With Google Apps Script, it’s totally possible! You can automate email alerts directly from Google Sheets based on cell values. This saves time, keeps your team in the loop, and makes your sheet way more powerful.
In this guide, we’ll walk through how to send custom email notifications when a certain condition is met in your sheet — no manual work needed. It’s like giving your spreadsheet a voice!
What Is a Custom Email Notification in Google Sheets?
A custom email notification is an automatic message sent by your sheet when a specific value appears in a cell. Using Google Apps Script, you can write a simple rule: “If column F says ‘APPROVED’, send an email to this person with these details.” The script runs every time the sheet changes, keeping everyone updated without you lifting a finger.
Why Use This?
- Automate alerts for task approvals, inventory levels, or deadlines
- Make sure nothing falls through the cracks
- Save time on manual follow-ups
Real-Life Example: Approving Requests in a Shared Sheet
Let’s say you have a shared sheet where team members submit requests for supplies. When a manager marks a row as “APPROVED”, you want an email to go out to the requestor with the approval details.
Sample Sheet Layout
Request ID | Name | Item | Quantity | Status | |
---|---|---|---|---|---|
001 | Jane Doe | Stapler | 2 | APPROVED | jane@example.com |
Once “APPROVED” is typed in the Status column (Column E), the script automatically sends a message to the email in Column F.
Step-by-Step: How to Send Emails Based on Cell Values
- Open your Google Sheet.
- Click Extensions > Apps Script.
- Delete any existing code and paste the following:
function onEdit(e) { var sheet = e.source.getActiveSheet(); var range = e.range; if (sheet.getName() === "Requests" && range.getColumn() === 5) { // Column E = Status var row = range.getRow(); var status = range.getValue(); if (status === "APPROVED") { var name = sheet.getRange(row, 2).getValue(); // Column B var item = sheet.getRange(row, 3).getValue(); // Column C var quantity = sheet.getRange(row, 4).getValue(); // Column D var email = sheet.getRange(row, 6).getValue(); // Column F var subject = "Your Request Has Been Approved!"; var body = "Hi " + name + ",\n\n" + "Your request for " + quantity + " x " + item + " has been approved.\n\n" + "Thanks,\nAdmin Team"; MailApp.sendEmail(email, subject, body); } } }
- Click the disk icon or press Ctrl + S to save the project.
- Close the editor — your email alerts are now ready to go!
Key Benefits
- Instant Alerts: Get notified right when something important changes.
- Time-Saving: No more manual email writing or checking the sheet constantly.
- Custom Messages: Personalize the email content with names and details from the sheet.
Pro Tips
- This script uses
onEdit()
, which triggers only on manual edits (not on formulas or scripts). - Make sure your sheet name in the script matches exactly, including capitalization.
- Use Data Validation to ensure only certain values (like “APPROVED”) can be entered in the Status column.
- You can log emails sent using
Logger.log()
for troubleshooting.
Customizing the Script
Want to send emails for other statuses like “REJECTED”? Just expand the if
block:
if (status === "APPROVED" || status === "REJECTED") {
// change email subject/body based on status
}
Quick Cheat Sheet
Function | Purpose |
---|---|
onEdit(e) |
Triggers when a cell is manually changed |
MailApp.sendEmail() |
Sends an email using Gmail |
e.range.getRow() |
Gets the row number of the edited cell |
sheet.getRange(row, col).getValue() |
Reads values from specific cells in the row |
Using Google Apps Script to send emails based on cell values is a simple way to make your spreadsheet smarter. Whether you’re approving requests, tracking orders, or managing tasks — automated notifications can streamline your workflow and keep everyone informed. Just set it once, and let your sheet do the talking!
Try it out on your own Google Sheet and start saving time while boosting productivity.