google sheet single cell email notification -


i trying create email notification when single cell or cell d28:d33 , l28:l33 display "complete".

below of codes able pull email notification changes row or column. need code specific cell.

so have put code, seems when click play goes through, still emails whenever on spreadsheet edited.

    function sendnotification() {       var ss = spreadsheetapp.getactivespreadsheet();       var sheet = ss.getactivesheet();       var cell = ss.getactivecell().geta1notation();       var row = sheet.getactiverange().getrow();       var cellvalue = ss.getactivecell().getvalue().tostring();       var range_bill_com = sheet.getrange("d28" || "d29" || "d30" || "d31" || "d32" || "d33");       var test = 0;       if (range_bill_com.getvalue() == "complete" && test == 0){          var recipients = "username@email.com";          var message = '';          var subject = 'update has been done '+sheet.getname();          var body = sheet.getname() + ' has been updated. visit link view changes ' + ss.geturl() + ' changes have been made row: «' + cell + '»';          mailapp.sendemail(recipients, subject, body);       test = 1;       }       }; 

i trying add value once email has been sent value changes test = 0 test = 1 doesn't resend email again.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -