so using the resources available here I managed to put together a code to send my colleagues a email when the button is pushed and everything works fine, the only issue I am having is converting a link to something they can just click on to access. Below is the code:
SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Email addresses").activate();
var sheet = SpreadsheetApp.getActiveSheet();
var startRow = 2; // First row of data to process
var numRows = 2; // Number of rows to process
// Fetch the range of cells A2:B3
var dataRange = sheet.getRange(startRow, 1, numRows, 2);
// Fetch values for each row in the Range.
var data = dataRange.getValues();
for (var i in data) {
var row = data[i];
var emailAddress = row[0]; // First column
var message = "Dear"+" "+row[1]+" "+"here are todays classifications."; // Second column
var DailyDips = "https://docs.google.com/spreadsheets/d/1ImiuI_osfShHHwA6lXn7npxgwRJ6wdM_l6dPhgcaFt4/edit#gid";
var message2 = "Click this link to access the sheet"+" "+DailyDips;
var message3 = <a href="https://docs.google.com/spreadsheets/d/1ImiuI_osfShHHwA6lXn7npxgwRJ6wdM_l6dPhgcaFt4/edit#gid">click here</a>;
var Sheets = [{fileName:sheetName+".xlsx", content:contents, mimeType:"application//xlsx"},{fileName:sheetName2+".xlsx", content:contents2, mimeType:"application//xlsx"}]
MailApp.sendEmail({
to: emailAddress,
subject: "Daily Dips",
htmlBody: message+'<br>'+message2,
attachments: Sheets
});
};
the issue being this portion:
var message3 = <a href="https://docs.google.com/spreadsheets/d/1ImiuI_osfShHHwA6lXn7npxgwRJ6wdM_l6dPhgcaFt4/edit#gid">click here</a>;
the last </a>; is in red and it complains about the token <, having a '" before and after returns the same issue.
Any ideas?