Я пытаюсь выполнить функцию Google Script под названием send Email с параметрами cc, b cc, темой и телом, как показано ниже
CODE.GS:
function sendEmail(cc, bcc , subject, body){
Logger.log("Reached sendEmail");
MailApp.sendEmail(cc, subject, body, {
bcc: bcc
});
}
HTML:
<!DOCTYPE html>
<html>
<head>
<base target="_top">
</head>
<body>
<div class = "formfield">
<textarea id= "cc-input-box" placeholder = "CC" rows="1" cols="80"><?= email ?></textarea>
<textarea id= "bcc-input-box" placeholder = "BCC" rows="1" cols="78"></textarea>
<textarea id= "subject-input-box" placeholder = "Subject" rows="1" cols="78"><?= subject ?></textarea>
<textarea id="body-input-box" placeholder = "Body"rows="34" cols="78"><?= body ?></textarea>
</div>
<input type="button" value="Submit"
onclick="google.script.run.sendEmail(document.getElementById('cc-input-box') , document.getElementById('bcc-input-box') , document.getElementById('subject-input-box') , document.getElementById('body-input-box')); google.script.host.close();" />
<input type="button" value="Cancel" onclick="google.script.host.close();"
/>
</body>
</html>
Я пытаюсь передать все соответствующие TextAreas в качестве параметров с помощью document.getElementById (). Однако, похоже, это не работает. По сути, я не знаю, как передать несколько параметров через onClick.