我有一个不起作用的功能。我不知道当我想找出变量是否不为空然后显示/写入变量时的语法是什么?
function contactUsMailer(e) {
try {
var recipient = "test@test.dk";
var timestamp = e.values[0];
var email = e.values[1];
var buffet = e.values[12];
var message = 'Kantine Rekvisition'+'<br>'
+'Afdeling: '+e.values[2]+'<br>'
+'Afd. nr.: '+e.values[3]+'<br>'
+'Til dato/kl.: '+e.values[8]+'<br>'+'<br>'
**if (buffet!='') {
+'Antal Buffet: '+ buffet + '<br>'**
var body = message;
var advancedArgs = {htmlBody:body, replyTo:email};
MailApp.sendEmail(recipient, "Kantine Rekvisition", body, advancedArgs);
} catch(e){
MailApp.sendEmail(recipient, "Error - Contact Us Form", e.message);
}
}