Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

244
Visualizações
Google Apps script- automated email when the checkbox is checked

**Hello All, I would like seek help on below google sheet script which is when the checkbox is checked it cannot auto send email with data column A to E and script i need to add?

const wholeSheet = SpreadsheetApp.getActive();
let sheetName = "name of your sheet";
let activeSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(sheetName);

function sendEmailWhenBoxIsChecked() {
  let columnIndexOfCheckbox = 6; //column index of where your checkbox is located
  let rowIndexOfCheckbox = 2; //column index of where your checkbox starts
  let activeCellOfActiveSheet = activeSheet.getActiveCell();
  if (
    activeCellOfActiveSheet.getColumn() === columnIndexOfCheckbox
    && activeCellOfActiveSheet.getRowIndex() >= rowIndexOfCheckbox
    && !activeCellOfActiveSheet.isBlank()
  ) {
    let checkbox = activeSheet.getActiveCell();
    if (checkbox.isChecked()) {
      GmailApp.sendEmail("recipient email", "Email header", "Email content or body");
    }

  }

}

function onEdit() {
  let createTrigger = true;
  ScriptApp.getProjectTriggers().forEach(trigger => {
    if (trigger.getEventType() === ScriptApp.EventType.ON_EDIT && sendEmailWhenBoxIsChecked.name === trigger.getHandlerFunction()) createTrigger = false;
  });
  if (createTrigger) {
    ScriptApp.newTrigger(sendEmailWhenBoxIsChecked.name)
      .forSpreadsheet(wholeSheet)
      .onEdit()
      .create();
  }
}

enter image description here

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda