google apps script - GAS Help - e-mailing cells from a range -


I am sending an automated e-mail based on a border in a spreadsheet, though I have a problem with a lot of users Does not look favorable - when e-mail is sent, values ​​are different from commas only, I would like to show them on different lines.

  var ss = SpreadsheetApp.getActiveSpreadsheet (); Var vJOresponses = ss.getSheetByName ("feedback"); Var vCodesDay = ss.getSheetByName ("Codes") var vLength = vJOresponses.getRange ("C2"). GetValue (); Var vResults = vJOresponses.getRange ("D2"). GetValue (); Var vemailAddresses = vJOresponses.getRange ("B2"). GetValue (); Var versubject = "These are your Wi-Fi codes!"; Var Detorense Dual = vCodesDay.getSheetValues ​​(1, 1, vResults, 1); Can anyone help?   

>

dozens of such code samples Examples are for achieving that outcome on the SO, do a quick search on "Send mail" with Google-Apps-Script tags ...

One of them helps to create an HTML table That looks better than simple \ n or below

is the code:

  // sends an email when ...... function email refreshments (line ) {Var sheet = SpreadsheetApp.getActiveSpreadsheet (). GetActiveSheet (); Var topic = "Need information:" + Sheet.Getrange ("F19"). get receive (); Var recipient = "testmail@gmail.com" var data = sheet.getRange ('A2: C25'). GetValues ​​(); // Define your range here var message = '& lt; HTML & gt; & Lt; BODY & gt; & Lt; Table style = "background color: lightblue; boundary-fall: collapse," range = 1 cell padding = 5> gt; & Lt; Tr & gt; '; // Color changes to color eventually (var row = 0; line & lt; data lamps; ++ row) {for (var col = 0; col & lt; data [0]; length; ++ Cole) {Message + = '& lt; Td> + Data [row] [cola] + '& lt; / Td> '; } Message + = '& lt; / Tr & gt; & Lt; Tr & gt; '; } Message + = '& lt; / Tr & gt; & Lt; / Table & gt; & Lt; / Body & gt; & Lt; / HTML & gt; '; MailApp.sendEmail (recipient, subject, "", {html body: message}); }    

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -