I am trying to send an email through a google spreadsheet on click of checkbox. Below is the code I am using
function onEdit(e){
var ss = e.source.getActiveSheet();
var ss_name = ss.getName();
var ui = SpreadsheetApp.getUi();//unused
if (ss_name == "Shopy"){
var row = e.range.getRow();
var col = e.range.getColumn();
if (col === 5 && row == 2){
if (ss.getRange("E2").getValue()){
checkIt(ss);
ss.getRange("E6").setValue("Report sent");
}
}
}
}
function checkIt(ss){
sendEmail(ss,ui);
}
Sheet is working till the UI bottom pops up for YES or No but I guess the function sendEmail(ss)
is not executing.
** Answer: ** Triggers won't work but using an image button works awesome