This is where I am at currently:
function sendEmails() {
//Function to send Emails
}
function onOpen() {
// Funtion 1 to add custom menu
var ui = SpreadsheetApp.getUi();
// Or DocumentApp or FormApp.
ui.createMenu('Custom Menu')
.addItem('Reminder', 'menuItem1')
.addToUi();
}
function menuItem1() {
// Funtion 2 to add custom menu
var sheet = SpreadsheetApp.getActiveSheet();
sheet.getUi() // Or DocumentApp or FormApp.
.sendEmails()
.alert('Reminder Emails Sent!');
}
This is the error I'm getting:
TypeError: Cannot find function getUi in object Sheet
The primary way I call the sendEmails() function is by scheduling it. I couldn't find a way to call this function manually via the menu.
Could you please help me out with this?
