0

I'm building a Sheets Script add-on for sending invoices. In my sheet, I have a chart with the dates written along a row. When I use the MailApp.sendEmail() the date is printed in the email differently then it does in the sheet. In the email it is: Tue Apr 05 2016 00:00:00 GMT-0400 (EDT)

However, I'd like it to simply be 4/5 [as it appears in the Google sheet cell]. Currently, my code looks like this:

JavaScript

function composeChart() {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sheet = ss.getSheets()[1]
  var data = sheet.getRange(4,2);
  var date = data.getValues();
  var chartComplete = titleChart+date+TD+date+TD+TR+endChart;
  testMailApp3(chartComplete);
}

function testMailApp3(chartComplete) {
  MailApp.sendEmail(
    'bakukai@gmail.com',         // recipient
    'test MailApp',                  // subject 
    chartComplete, {                        // body
      htmlBody: chartComplete//html                 // advanced options
    }
  );

PS: my HTML chart is coming out incorrectly too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.