There is a google table with postal addresses. There is a script: when I select the address of a specific person, click on the button, the script for sending him a letter is executed. (The code was copied from the Internet, I edited it, I think there are errors, but it works - well, okay).
function sendEmails() { var sheet = SpreadsheetApp.getActiveSheet(); var activeRange = sheet.getActiveRange(); var rows = sheet.getLastRow(); var dataRange = sheet.getRange(1, 1, rows, 2) var data = activeRange.getValues(); for (var i = 0; i < data.length; ++i) { var row = data[i]; var name = row[0]; var email = row[1]; //var emailReplyTo = "manager@site.com"; var subject = "Тема письма"; var body = "Тест, " + name + "! проверка рассылки"; // Отправляем письмо MailApp.sendEmail({to: email, subject: subject, htmlBody: body}); //записываем значение «Отправлено» в третью колонку sheet.getRange(i+1, 3).setValue("Отправлено"); SpreadsheetApp.flush(); <span id="pastemarkerend"> </span> } } It works with the laptop, but not with the phone. But I need the script to work from the phone, when I don’t have access to the laptop. How can I do that? I thought I could make another column in which, if you enter the word "Yes", then this script will execute mine. But how to do that? I can not find anything on the Internet, I do not know how to google.
Plus, another question.
sheet.getRange(i+1, 6).setValue("Отправлено"); How can I make the Sent message exactly in the line to which I sent the letter, and not in the first one only?
Or tell me what functions to google and in which direction to search. thank