So im using the following code for sendFormByEmail and it works great for sending the required information by email. The only problem is its sending a blank email with all the fields left blank except for the timestamp at the same time. Ive checked for multiple triggers and have removed the trigger and added another one. same thing
the code is
{
var s = SpreadsheetApp.getActiveSheet();
var headers = s.getRange(1,1,1,26).getValues()[0];
var email = "jlewis@xxxxxxx.ca";
var subject = "Service Call";
var message = "";
for(var i in headers) {
if (e.namedValues[headers[i]]) {
message += headers[i] + ' : '+ e.namedValues[headers[i]].toString() + "\n\n";
}
}
MailApp.sendEmail(email, subject, message);
}