I have a script that is supposed to send an email but it will only work in certain circumstances.
The first snippet will send the mail; the second will finish without errors without sending it. In short, if I have the variables there it will not sent.
var schoolYear = "2017-2018"
var message = "Please see the attachment for the " + schoolYear + " SGA class election name confirmation sheet. Have a great day B!";
var subject = schoolYear + " SGA Class Election Name Confirmations"
var email = "austin.hoag@icloud.com"
var name = "FHS SGA Election Name Confirmation"
MailApp.sendEmail(email, "subject", "message", {name: name});
var schoolYear = "2017-2018"
var email = "austin.hoag@icloud.com"
var name = "FHS SGA Election Name Confirmation"
var message = "Please see the attachment for the " + schoolYear + " SGA class election name confirmation sheet. Have a great day B!";
var subject = schoolYear + " SGA Class Election Name Confirmations"
MailApp.sendEmail(email, subject, message, {name: name});