Answer the question
In order to leave comments, you need to log in
How to automatically send emails from Google Sheets by condition?
You need to set up a script that will run every minute through a standard trigger and check, for example, column A, if the value in the line is "New", then these lines are sent by mail using the script, and then change the cell value to "Sent".
Those. with a new trigger, there may be 0.1 or more rows with the value "New", you need to send these rows and change the value to "Sent".
How to write such a script?
For now, there is such a script that works when manually started.
function sendSelectedEmails() {
var sheet = SpreadsheetApp.getActiveSheet();
var activeRange = sheet.getActiveRange();
var data = activeRange.getValues();
for (i in data) {
var row = data[i];
var emailAddress = "ХХХХХХХХХХХХ@gmail.com";
var subject = "ХХХХХХХХХХХХ";
var message = row[0];
MailApp.sendEmail(emailAddress, subject, message);
}
}
Answer the question
In order to leave comments, you need to log in
It has already been , look - several options have been proposed
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question