Service called many times not same day; or, em portuguese: Serviço chamado muitas vezes no mesmo dia:

215 views
Skip to first unread message

roger roger

unread,
Aug 18, 2017, 2:12:23 PM8/18/17
to Google App Engine
I am trying to run this script in a googlesheet, but, the following erros msg appears: Service called many times not same day; or, em portuguese: Serviço chamado muitas vezes no mesmo dia: email. (linha 29, arquivo "Copia_20171")

function sendEmails20171() {
  
   var planilha2017_1 = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('2017_1'); //"Armazena" a planilha 2017 na variável 20171
   var manipula2017_1 = planilha2017_1.getRange(1, 7, planilha2017_1.getLastRow() - 1, 2).getValues(); //Configura pra pegar linhas e colunas de planilha20171,
    //armazenando-os na variável manipula20171
   var colunaAssunto = planilha2017_1.getRange(1, 2, planilha2017_1.getLastRow() - 1, 2).getValues();//pega o assunto, linha 2, coluna 3.
   var colunaSecaoResp = planilha2017_1.getRange(1, 8, planilha2017_1.getLastRow() - 1, 2).getValues();//pega a seção, linha 2, coluna 8.
   var colunaTitularSecao = planilha2017_1.getRange(1, 10, planilha2017_1.getLastRow() - 1, 2).getValues();//pega o titular da seção, linha 2, coluna 10.
  
  var nomePlanilha = planilha2017_1.getName(); //pega o nome da planilha
  var email = 'rogerio....@tr.jus.br';
 
  var link2017_1 = 'https://goo.gl/xF5Nbg'; 
  
  for (var i = 0; i < manipula2017_1.length; i++) {
     if (manipula2017_1[i][1] <=300 && manipula2017_1[i][1] > -720 ) { //o alerta dispara quando faltam menos de cinco dias para vencer e até depois de dois 
       //anos vencidos - e não cumprido.
         var assuntoPlanilha = colunaAssunto[2][5];// pega o assunto da planilha
         var secaoResp = colunaSecaoResp[3][5];// pega a seção responsavel
         var titularSecao = colunaTitularSecao[i][1];// pega o titular da seção.
         var link2017Celula = linkCelula+[i+1]+":"+[i+1]; 
              
         var dias = manipula2017_1[i][1]; //pega os dias vencidos
         var assuntoEmail = secaoResp + " - \nPrazo de monitoramento em " + '"' + nomePlanilha + '"' + " vencendo em " + dias + " dias";


       MailApp.sendEmail(email, assuntoEmail, "Assunto: " + assuntoPlanilha + " \nSeção Responsável: " + secaoResp + " \nSeção Responsável: " + 
                      + "\nPara maiores detalhes, clique aqui: ");
      
    } 
  }
}

Yannick (Cloud Platform Support)

unread,
Aug 18, 2017, 3:20:51 PM8/18/17
to Google App Engine
Hello Roger, this forum is about App Engine, a component of the Google Cloud Platform that is not related to Apps Script.

You can find out how to get help for Apps Script in this document.
Reply all
Reply to author
Forward
0 new messages