Apologises as I know this has been asked a few times, which I have learnt from other questions, however I'm still stuck and not sure how to continue.
I'm trying to make a google script to send an email notification to more then one person, based on a cell change, also sending in the email multiple cell values in the same row?
e.g. If Column 'C' changes, can I send an email with data from Column 'A' and 'B' in the same Row of the change in column 'C'?
This is the script I've been trying to play around with but not sure how to add multiple e-mails, and values from two more cells.
function sendNotifications() {
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 recipients = [email protected]";
var message = '';
var cellA = ''
if(cell.indexOf('B')!=-1){
message = sheet.getRange('A'+ sheet.getActiveCell().getRowIndex()).getValue()
}
var subject = 'Update to '+sheet.getName();
var body = + cellvalue + '». For message: «' + message + '»';
MailApp.sendEmail(recipients, subject, body);
};
,
. Acquiring the data from another cell could be done through getRange() – Casper