Your script, blahblahblah, has recently failed to finish successfully. A summary of the failure(s) is shown below. To configure the triggers for this script, or change your setting for receiving future failure notifications, click here.Start: 5/21/19 4:57 PMFunction: sendResponseToPlayerError Message: Failed to send email: no recipient (line 97, file "blahblahblah")Trigger: formSubmitEnd: 5/21/19 4:57 PMSincerely,Google Apps Script
function sendResponseToPlayer(e) {
var values = e.namedValues;
var pfname = values['First Name'].toString();
var plname = values['Last Name'].toString();
var pyn = values['Playing?'].toString();
var pem = values['Email Address'].toString();
// Acknowledge their response
var subject = 'Player Response ';
var hbody = '';
hbody += "<p>Thank you, " + pfname + ". You have answered \"" + pyn + "\" to playing this week.</p>";
// Add document text
var body = DocumentApp.openByUrl('https://docs.google.com/document/d/123abc/edit').getBody();
var bodyTextElement = body.editAsText();
var bodyString = bodyTextElement.getText();
hbody += "<p>" + bodyString + "</p>";
// Add spreadsheet text
var sheet = SpreadsheetApp.openByUrl('https://docs.google.com/spreadsheets/d/abc123/edit#gid=0');
var values = sheet.getActiveSheet().getDataRange().getDisplayValues();
for (var i = 0; i < values.length; i++) { // length of first dimension of 2d array
for (var j = 0; j < values[i].length; j++) { // length of dimension of specific row
hbody += values[i][j] + " ";
}
hbody += "<br>";
}
hbody += "<p>Please see attachments.</p>";
var fid = '789xyz';
var file = DriveApp.getFileById(fid);
var fcal = 'xyz789';
var calfile = DriveApp.getFileById(fcal);
var replem = 'm...@gmail.com';
MailApp.sendEmail({
to: pem,
replyTo: replem,
subject: subject,
htmlBody: hbody,
attachments: [file.getAs(MimeType.PDF),calfile.getAs(MimeType.PDF)],
name: 'me'
});
}
file = file.getAs(MimeType.PDF);
MailApp.sendEmail({
to: pem,
replyTo: replem,
subject: subject,
htmlBody: hbody,
attachments:
filesToAttach,
name: 'me'
});
} catch(e){
MailApp.sendEmail({
to: pem,
subject: subject,
htmlBody:'There was an error'
})
}
you might start seeing an error if the form field for the email address has been renamed. Currently your script is looking for a field called 'Email Address'. Has this changed?
--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-script-community.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/f9721ca2-5331-4ce2-b45a-05bc53bd6721%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
"It seems clear that the waves of lawsuits breaking on the shores of the new surveillance fortress are unlikely to alter the behavior of surveillance capitalists." (Zuboff 2015) https://t.co/fTEXuRQK9t
— Billy Meinke-Lau (@billymeinke) May 6, 2019