Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9788

Convert Script into HTML and have links embedded

$
0
0

I have the below script and want to have the URL links embedded instead of the whole link appearing on the automatic emails, but don't know how to convert this script into an htmlbody script to have that done....

function onFormSubmit() {  var sheet = SpreadsheetApp.getActiveSheet();  var startRow = 2; // First row of data to process  var numRows = sheet.getLastRow(); // Number of rows to process, dynamically fetched based on the last row with value  var dataRange = sheet.getRange(startRow, 1, numRows, sheet.getLastColumn());  // Fetch values for each row in the Range.  var data = dataRange.getValues();  var spreadsheet = SpreadsheetApp.getActiveSpreadsheet(); //Moved code outside of the for loop to increase efficiency    for (var i = 0; i < data.length; ++i) {    var row = data[i];    var emailAddress = row[8];     var emailSent = row[9];    var Email_Sent = "Email_Sent";    if (emailSent != Email_Sent && emailAddress) { // Prevents sending duplicates and blank email       var emailAddress = row[8];        var body = 'A new office event booking has been submitted to the Internal Event Booking Form for your office that requires your attention: "https://docs.google.com/spreadsheets/d/??????????????????????????????"'       var subject = 'New internal event request, please check the internal event booking sheet';       MailApp.sendEmail(emailAddress, subject, body, { noReply: true });      sheet.getRange(startRow + i, 10).setValue(Email_Sent);      // Make sure the cell is updated right away in case the script is interrupted      SpreadsheetApp.flush();    }  }}

Any help will be greatly appreciated!

Thank you all in advance!


Viewing all articles
Browse latest Browse all 9788

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>