In this challenge, you want to pass two variables, ‘studentEmail’ and ‘message’, to the function emailStudent.To do this, you’ll need to add the variables as parameters to both the function CALL, and the function DEFINITION.Once you’ve done this, use the Logger.log command to log both variables and make sure they made it to the emailStudent function.
Either make a copy of this script file or copy and paste the code below into a new file.
function myFunction() { var studentEmail = "johnnysmith@school.edu"; var message = "Johnny is doing well in school."; emailStudent(); } function emailStudent(){ }
Google Scripts Lessons 1-10
Click on a lesson below for a written tutorial demonstrating the lesson.
- Lesson 1 – “Hello World!”
- Lesson 2 – Challenge: Calling Functions
- Lesson 3 – Variables
- Lesson 4 – Variable Passing
- Lesson 5 – Variable Passing Challenge
- Lesson 6 – Arrays of Variables
- Lesson 7 – Modifying a Google Doc
- Lesson 8 – Modify Doc and Send Email
- Lesson 9 – Simple Feedback script
- Lesson 10 – Full-scale feedback