I'm trying to follow this guide (Never programed before):
https://www.groovypost.com/howto/google-sheets-send-email-based-on-cell-value/
But It keeps giving me the error:
Exception: The parameters (number[],String,String) don't match the method signature for MailApp.sendEmail. sendEmail @ Send Email.gs:8
For what I understand this means the email value is taking as a number. But I have no idea how to solve this.
function sendEmail() {
// Fetch the email address
var emailRange = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Client Input").getRange("D2");
var emailAddress = emailRange.getValues();
// Send Alert Email.
var message = 'Please go to your Issues Tracker for more information'; // Second column
var subject = ' Notification Action Required';
MailApp.sendEmail(emailAddress, subject, message);
}
emailRange.getValues()returns a two dimensional array - CooperemailRange.getValues().flat().join(',');- Cooper