I'm trying to send an email from Google Sheets to update staff if they have filled a particular form out. The emails I need to be sent are sitting in the google sheet with the finish the form.

If there are 5 emails in the sheet, I need a draught email sent to them with a link attached.

I know you can send an email based on a value in a cell but I need an email sent to addresses that appear in the sheet.

***Example***

me@email.com

you@email.com

everyone@email.com

*SEND LINK*

The Apps Script needs to pick up those 3 emails and send the link I need them to receive.
['https://Stackoverflow.com/questions/73438985', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/16903576/']
### A simple Example

```
function sendEmIfTheyreThere() {
  const ss = SpreadsheetApp.getActive();
  const sh = ss.getSheetByName("Sheet0");
  const vs = sh.getDataRange().getValues();
  vs.forEach((r,i)=> {//for loop using arrow notation
    if(r[0] && r[1] && r[2] && !r[3]) {//look for truthiness of column1,column2 and column3 and the falsiness of column4
      GmailApp.sendEmail(r[0],r[1],r[3]);//send email
      sh.getRange(i + 1,4).setValue("SENT")//put sent into column 4 to prevent emails for this row being sent again
    }
  });
}

```

Sheet0:

| TO | FROM | MESSAGE | SENT |
| --- | --- | --- | --- |
| comma separated emails | single email | Text |  |
Since you know how to send emails to a cell, you could jam all the addresses into a cell with `textjoin`, and separate them with `;` That would setup your addresses to send to...

So say in cell `C1` you could put `=TEXTJOIN(";",true,A:A)` (assuming column a has addresses).

Then you would have your addresses just as a single cell with...

```
var addressesToSend = SpreadsheetApp.getActiveSheet().getRange('C1').getValue();

```

The alternative method would be to use app scripts to create an array and then join them, but if you've never done that before, I'd go with the textjoin approach.