I have a "for" that runs through the lines of a spreadsheet and sends an email if it is less than 5 days to complete a task. My intention is when the user receives the email with the warning, it informs if the task has been fulfilled, and stop receiving alerts; to do so, it clicks on a link, which deletes its email in the corresponding task sheet. How can I do this in the code below?
for (var i=0;i<numRows-startRow;i++){
var expire = dataRange[i][9];
if (expire < 6) {
var emailAddress = dataRange[i][7];
var subject = "Você tem um prazo vencendo em " + dataRange[i];
var message = "<P><r style='color: #000000; font-size: 12px; font-weight:bold;'>
"Caso a medida já tenha sido cumprida, clique <A href='https://url_da_planilha'>aqui</A> </i></P>"
MailApp.sendEmail({
to: emailAddress.toString(),
subject: subject,
htmlBody: message
});
}