Q: Google Sheets Personal URLs Auto Email I have a code that allows me to send an email with a trigger. Everything works except "currentO" which is personal link to each individual so no two links are the same. I have the links in the cell with a hyperlink but it just sends as a plain text. I would like it to be clickable.
Ive tried html sender ( didnt like it), using geturl, var herf,and using the raw url but none of it works. Am I misunderstanding something? I am new to google coding still.
function SendEmail(e) {
      // get the row and column of the edited cell
      var row = e.range.getRow();
      var column = e.range.getColumn();
      // proceed only if edited cell's range is D2:D and value is "TRUE"
      if (row > 1 && column == 5 && e.value == "TRUE") {
        // get the sheet where the cell was edited
        var ss = e.source.getActiveSheet();
        // get Email and ADID of the same row where checkbox was ticked
        var currentEmail = ss.getRange(row, 2).getValue();
        var currentA = ss.getRange(row, 3).getValue();
        var currentR = ss.getRange(row,1).getValue();
        var currentO= ss.getRange(row,9).getValue();
        //var ss = SpreadsheetApp.getActiveSpreadsheet();
        //Logger.log(ss.getUrl(row,9));
        MailApp.sendEmail(currentEmail,"You have an upcoming install:  " + currentA, "Hey " + currentR + ",\n\nYou have a customer " + currentA + " who needs help with an appointment. Please reach out to them to remind them and resolve any potential issues.\n\nPlease let me know if anything comes up. \n\nCustomer Name: " + currentA + "\n\nlink to the customers page: " + currentO + "\n\nThank you \n\nManagement");
      }
}


A: Replace email code lines with below:
MailApp.sendEmail(
    {
     to:currentEmail, 
     subject:"You have an upcoming install:" + currentA,
     htmlBody: 
     "Hey " + currentR + "," + '<br><br>' + "You have a customer " + currentA + " who needs help with an appointment. Please reach out to them to remind them and resolve any potential issues." +'<br><br>' + "Please let me know if anything comes up." +'<br><br>'+ "Customer Name: " + currentA  + '<br><br>' + "link to the customers page: " +'<a href="' + currentO + '" >' + currentO  + '</a>' 
 + '<br><br>'+ "Thank you Management"
     
     
     });  
    
  }


A: Use the htmlBody parameter of MailApp.sendMail(), and check your quotes.
function myFunction() {
  let currentEmail = "foo@bar.eu"
  let current0 = '<a href="https://www.google.com">Link</a>';
  MailApp.sendEmail(
    {
      to: currentEmail,
      subject: "You have an upcoming install",
      htmlBody: "link to the customers page: " + current0
    });
}

