google spreadsheet - Adding multiple lines of body in script editor -
i using following code in spreadsheet send emails.
// constant written in column c rows email // has been sent successfully. var email_sent = "email_sent"; function sendemails2() { var sheet = spreadsheetapp.getactivesheet(); var startrow = 2; // first row of data process var numrows = 2; // number of rows process // fetch range of cells a2:b3 var datarange = sheet.getrange(startrow, 1, numrows, 3) // fetch values each row in range. var data = datarange.getvalues(); (var = 0; < data.length; ++i) { var row = data[i]; var emailaddress = row[0]; // first column var message = row[1]; // second column var emailsent = row[2]; // third column if (emailsent != email_sent) { // prevents sending duplicates var subject = "sending emails spreadsheet"; mailapp.sendemail(emailaddress, subject, message); sheet.getrange(startrow + i, 3).setvalue(email_sent); // make sure cell updated right away in case script interrupted spreadsheetapp.flush(); } } } in above message being processed single cell while want use multiple cells.
example: the second column contains body sent
how can tweak same.
put message in single cell , format wish within cell. i.e. if want skip down line or 2 hold control , press return , cursor go next line.
Comments
Post a Comment