function SendEmailSheet1() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var filename = " Sheet1" + ss.getName();
var SendBook = ss.copy(filename);
MailApp.sendEmail({
to: ToUser,
subject: 'Here is my test email!',
body: 'Hi! I have attached my test timesheet. Thanks for the work, really appreciate it! -Lori',
attachments: [SendBook.getBlob().setName(filename)]
});
}
I have tried other scripts but they are more complicated and I am a beginner user. This one would be perfect if it did not create a copy. I also need to add a script that can be triggered to update a date in a cell that will update the timesheet every 2 weeks and uses this script to email the new pdf automatically.