I am trying to create a code that will read the current time and determined which shift we are PM or AM, this date should also give me the day of the week because I will use the day of the week on the email title and body. However, I am still stuck on the logic to send the email without any of those requirements.
I am currently facing this issue where the code runs, but the email never gets sent. Can someone please help me?
Here is my code:
function sendemail() {
var file = SpreadsheetApp.openById('1vQIpduKw8qp65oNMJt5XsTNOMQEsNaR8FA64kL1GXi0')
const d = new Date()
let day = d.getDay()
var emailcontent = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("CO Plan Release").getRange("B2:G22")
}
function sendEmail() {
var recipients = 'jessica.sartori@gmail.com'
var text = 'CO Plan Review'
MailApp.sendEmail(recipients, text, testTableHTML(emailcontent))
}
function testTableHTML() {
var file = SpreadsheetApp.openById('1vQIpduKw8qp65oNMJt5XsTNOMQEsNaR8FA64kL1GXi0')
emailcontent = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("CO Plan Release").getRange("B2:G22")
return (tableHTML(emailcontent))
}
function tableHTML(emailcontent) {
var data = emailcontent.getDisplayValues()
var taille = emailcontent.getFontSizes()
var fond = emailcontent.getBackgrounds()
var couleur = emailcontent.getFontColors()
var police = emailcontent.getFontFamilies()
}
I tried different ways of doing this mail function but none of them seem to work. Can someone help with -Making the function email work -Getting the correct logic to send the email based on the day they are access the code
Via Active questions tagged javascript - Stack Overflow https://ift.tt/pRK8Ccz
Comments
Post a Comment