SHARE
TWEET

Send email from google sheets based on active row

ranjithkumar10 Aug 12th, 2016 890 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function activeRowEmail() {
  2. var sheet = SpreadsheetApp.getActiveSheet();
  3. var activeRow = sheet.getActiveCell().getRowIndex();
  4. var name = sheet.getRange(activeRow, 1).getValue();
  5. var email = sheet.getRange(activeRow, 2).getValue();
  6. var score = sheet.getRange(activeRow, 3).getValue();
  7. MailApp.sendEmail(email,"custom email","hello " + name + ", This is an email report of your score. Your score is " + score);
  8. }
  9.  
  10. ##credits - https://codingislove.com
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top