Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

174
Views
¿Cómo detener mi secuencia de comandos emitiendo continuamente correos electrónicos?
function reminder() { var sh = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); var data = sh.getDataRange().getValues(); var d = new Date().getTime(); for (var i = 1; i < data.length; i++) { var recipients = data[i].slice(3, 6).filter(String).join(","); if (recipients == "") continue; if (data[i][6] <= new Date(d + 7 * 24 * 60 * 60 * 1000) && data[i][6] >= new Date(d + 5 * 24 * 60 * 60 * 1000) && data[i][7] == '') { MailApp.sendEmail({ to: recipients, subject: 'Reminder Process Update Required in 1 week', htmlBody: 'Hello ' + data[i][2] + ', the process page for <b>' + data[i][1] + '</b> is due for review in 1 week. Please review the content and contact the Process team before its due date if amendments are required.' }); sh.getRange(i + 1, 9).setValue('sent'); } else if (data[i][6] <= new Date(d + 30 * 24 * 60 * 60 * 1000) && data[i][6] >= new Date(d + 28 * 24 * 60 * 60 * 1000) && data[i][7] == '') { MailApp.sendEmail({ to: recipients, subject: 'Reminder Process Update Required in 1 month', htmlBody: 'Hello ' + data[i][2] + ', the process page for <b>' + data[i][1] + '</b> is due for review in review in 1 month. Please review the content and contact the Process Mapping team before its due date if amendments are required.' }); sh.getRange(i + 1, 8).setValue('sent'); } } }

Actualmente me enfrento a este problema 1), si la fecha de vencimiento es 1 semana en la tabla, el script emitirá continuamente el correo electrónico y aplicará "enviado" en la tabla, aunque seguirá enviando los correos electrónicos, 2). Si la fecha de vencimiento es 1 mes, se emitirá el correo electrónico; sin embargo, una vez que se ingrese "enviado" en la hoja, no se emitirán más correos electrónicos, lo cual está bien hasta que esto cause un problema cuando la fecha sea 1 semana antes, entonces no se emitirá. el segundo correo electrónico de recordatorio informando su fecha de vencimiento

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!