I've got a google apps script UI I am using in a google doc.
I'm trying to replace the current handler which uses the Script DB. Script DB has since been deprecated. The amount of information I was writing was minimal and I figured I would just write the info to google sheets.
Here is the handler from the .html
function addApprover(){
google.script.run.withSuccessHandler(function() {
getApprovers();
$('#approver').val('');
}).addApprover($("#approver").val());
}
.gs
function addApprover(email){
var db = ScriptDb.getMyDb();
var docId = DocumentApp.getActiveDocument().getId();
var ob = {
docId: docId,
approverEmail: email,
status: null,
emailSent: false
}
db.save(ob);
var history = {
docId: docId,
action: 'Added Approver',
email: email,
date: Utilities.formatDate(new Date(), "GMT", "MM-dd-yyyy' 'HH:mm:ss"),
}
db.save(history);
}
I figure that I still call the .gs function and just need to change the function accordingly.
I'm fairly certain that the text box approver holds the email addresses.
How do I access these items?
I'm fairly certain I'm looking for a "for each" statement to iterate through each email address and send them a message and write their name to a specific area of a sheet but I am unsure how to proceed.