Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Recall & Review
beginner
What is the main Google Sheets feature used to send emails automatically?
Google Sheets uses Google Apps Script to send emails automatically based on sheet data.
Click to reveal answer
beginner
Which function in Google Apps Script sends an email?
The function MailApp.sendEmail() is used to send emails from Google Sheets scripts.
Click to reveal answer
intermediate
How do you trigger an email to send when a sheet is edited?
You create an onEdit(e) trigger function in Apps Script that runs when the sheet changes, then use MailApp.sendEmail() inside it.
Click to reveal answer
beginner
What information do you need to provide to MailApp.sendEmail() to send an email?
You need to provide the recipient's email address, subject line, and message body at minimum.
Click to reveal answer
beginner
Why is it important to test your email script with your own email first?
Testing ensures your script sends emails correctly and avoids spamming others by mistake.
Click to reveal answer
Which Google Sheets feature allows you to write code to send emails?
AConditional Formatting
BData Validation
CGoogle Apps Script
DPivot Tables
✗ Incorrect
Google Apps Script lets you write code to automate tasks like sending emails.
What is the correct method to send an email in Google Apps Script?
AMailApp.sendEmail()
BEmail.send()
CsendMail()
DMail.sendEmail()
✗ Incorrect
The correct method is MailApp.sendEmail() to send emails from scripts.
Which trigger runs a function when you edit a Google Sheet?
AonEdit(e)
BonOpen()
ConChange()
DonSubmit()
✗ Incorrect
The onEdit(e) trigger runs when a user edits the sheet.
What minimum information is needed to send an email with MailApp.sendEmail()?
AMessage body only
BRecipient email only
CSubject and message body only
DRecipient email, subject, message body
✗ Incorrect
You must provide recipient email, subject, and message body to send an email.
Why should you test your email script with your own email first?
ATo save email credits
BTo avoid sending wrong emails to others
CTo speed up the script
DTo change the email format
✗ Incorrect
Testing prevents accidental emails to others and ensures the script works.
Explain how you can send an email automatically when a Google Sheet is edited.
Think about what happens when you change the sheet and how the script reacts.
You got /4 concepts.
List the key parts needed to send an email from a Google Sheets script.
What does an email always need to have?
You got /4 concepts.
Practice
(1/5)
1. What is the main purpose of using Google Apps Script to send emails from Google Sheets?
easy
A. To protect the sheet with a password
B. To send emails automatically using data from the sheet
C. To create charts and graphs in the sheet
D. To sort data alphabetically
Solution
Step 1: Understand the role of Google Apps Script
Google Apps Script allows automation in Google Sheets, including sending emails.
Step 2: Identify the purpose related to emails
The script reads data from the sheet and sends emails automatically, saving time.
Final Answer:
To send emails automatically using data from the sheet -> Option B
Quick Check:
Sending emails = To send emails automatically using data from the sheet [OK]
Hint: Remember: Apps Script automates tasks like emailing [OK]
Common Mistakes:
Confusing email sending with data sorting
Thinking Apps Script only creates charts
Assuming it protects sheets with passwords
2. Which of the following is the correct way to send an email using Google Apps Script in Google Sheets?
easy
A. MailApp.sendEmail(recipient, subject, body);
B. EmailApp.sendMail(recipient, subject, body);
C. Mail.sendEmail(recipient, subject, body);
D. SendMailApp.email(recipient, subject, body);
Solution
Step 1: Recall the correct Google Apps Script email function
The correct service is MailApp with the method sendEmail.
Step 2: Verify the syntax
The syntax is MailApp.sendEmail(recipient, subject, body); which matches MailApp.sendEmail(recipient, subject, body);.
Final Answer:
MailApp.sendEmail(recipient, subject, body); -> Option A
Quick Check:
Correct function = MailApp.sendEmail(recipient, subject, body); [OK]
Hint: Use MailApp.sendEmail() to send emails [OK]
Common Mistakes:
Using wrong service names like EmailApp or SendMailApp
Mixing method names like sendMail instead of sendEmail
Incorrect order or spelling of parameters
3. Given this script snippet in Google Sheets:
function sendEmails() {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var email = sheet.getRange('A2').getValue();
var message = sheet.getRange('B2').getValue();
MailApp.sendEmail(email, 'Hello', message);
}
What happens when you run sendEmails()?
medium
A. Nothing happens because sendEmail is not a valid method
B. An error occurs because getRange needs row and column numbers
C. The script sends emails to all rows in the sheet
D. An email is sent to the address in cell A2 with the message from B2
Solution
Step 1: Analyze the script's actions
The script gets the email from cell A2 and message from B2, then sends an email.
Step 2: Confirm the method usage
getRange('A2') and getRange('B2') are valid, and MailApp.sendEmail is correct.
Final Answer:
An email is sent to the address in cell A2 with the message from B2 -> Option D
Quick Check:
Email sent to A2 with B2 message = An email is sent to the address in cell A2 with the message from B2 [OK]
Hint: Check cell references and MailApp method correctness [OK]
Common Mistakes:
Thinking getRange('A2') is invalid syntax
Assuming the script sends emails to all rows automatically
Believing sendEmail is not a valid method
4. You wrote this script to send emails from your sheet:
function sendEmails() {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var email = sheet.getRange('A2').getValue();
var message = sheet.getRange('B2').getValue();
MailApp.sendEmail(email, 'Subject', message)
}
But it does not send any emails. What is the likely problem?
medium
A. You forgot to authorize the script to send emails
B. Missing semicolon after sendEmail line causes script failure
C. getRange('A2') is incorrect syntax
D. MailApp.sendEmail requires four parameters
Solution
Step 1: Check syntax and parameters
The script syntax is mostly correct; missing semicolon is not fatal in Apps Script.
Step 2: Consider authorization requirements
Google Apps Script requires user authorization to send emails; without it, emails won't send.
Final Answer:
You forgot to authorize the script to send emails -> Option A
Quick Check:
Authorization needed for sending emails = You forgot to authorize the script to send emails [OK]
Hint: Always authorize scripts before sending emails [OK]
Common Mistakes:
Assuming missing semicolon stops script
Thinking getRange('A2') is invalid
Believing sendEmail needs four parameters
5. You want to send personalized emails to multiple recipients listed in column A, with messages in column B, starting from row 2. Which script correctly sends emails to all rows with data?
hard
A. function sendAllEmails() {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var lastRow = sheet.getLastRow();
for (var i = 2; i <= lastRow; i++) {
var email = sheet.getRange('A' + i).getValue();
var message = sheet.getRange('B' + i).getValue();
MailApp.sendEmail(email, message, 'Hello');
}
}
B. function sendAllEmails() {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var lastRow = sheet.getLastRow();
for (var i = 1; i < lastRow; i++) {
var email = sheet.getRange(i, 1).getValue();
var message = sheet.getRange(i, 2).getValue();
MailApp.sendEmail(email, 'Hello', message);
}
}
C. function sendAllEmails() {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var lastRow = sheet.getLastRow();
for (var i = 2; i <= lastRow; i++) {
var email = sheet.getRange(i, 1).getValue();
var message = sheet.getRange(i, 2).getValue();
MailApp.sendEmail(email, 'Hello', message);
}
}
D. function sendAllEmails() {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var lastRow = sheet.getLastRow();
for (var i = 2; i <= lastRow; i++) {
var email = sheet.getRange(i, 1).getValue();
var message = sheet.getRange(i, 2).getValue();
MailApp.sendEmail('Hello', email, message);
}
}
Solution
Step 1: Check loop range and indexing
The loop must start at row 2 to skip headers and go to lastRow inclusive.
Step 2: Verify getRange usage and sendEmail parameters
Using getRange(row, column) is correct. sendEmail parameters are (email, subject, message).
Final Answer:
Loops from row 2 to lastRow and sends emails with correct parameters -> Option C
Quick Check:
Loop from 2 to lastRow, sendEmail(email, subject, message) = function sendAllEmails() {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var lastRow = sheet.getLastRow();
for (var i = 2; i <= lastRow; i++) {
var email = sheet.getRange(i, 1).getValue();
var message = sheet.getRange(i, 2).getValue();
MailApp.sendEmail(email, 'Hello', message);
}
} [OK]
Hint: Loop from row 2; use sendEmail(email, subject, message) [OK]