I got stuck here. I have read several solutions but still not able to figure out what is wrong. what to do?
function sendPDFForm()
{
var row = SpreadsheetApp.getActiveSheet().getActiveCell().getRow();
sendEmailWithAttachment(row);
}
function sendEmailWithAttachment(row)
{
var filename= 'Poster-CoV-WS-E1-merged.pdf';
...
}
function getClientInfo(row)
{
var sheet = SpreadsheetApp.getActive().getSheetByName('test');
if (sheet != null) {
var values = sheet.getRange('A2:B4').getValues();
//var values = sheet.getRange(row,1,row,3).getValues();
var rec = values[0];
}
var client =
{
first_name: rec[0],
email: rec[1]
};
client.name = client.first_name;
return client;
}
function sendFormToAll()
{
var sheet = SpreadsheetApp.getActive().getSheetByName('test');
var last_row = sheet.getDataRange().getLastRow();
for(var row=2; row <= last_row; row++)
{
sendEmailWithAttachment(row);
sheet.getRange(row,4).setValue("email sent");
}
}
here I have shared the complete code. While running it it is showing error inline 54 only
sheet
isnull
(Is the sheet name correct?)=>rec
isundefined
– TheMasterLogger.log(sheet)
– TheMaster