我希望在脚本中通过电子邮件共享Google工作表。此代码正确创建了电子邮件草稿,并在工作表中插入了超链接。当您将其作为驱动器链接插入GMAIL时,我希望它看起来像它。
Here is a sample of what it looks like when you insert as a drive link
代码:
function getSheetId() {
return SpreadsheetApp.getActiveSheet().getSheetId().toString();
};
function getSheetUrl() {
var SS = SpreadsheetApp.getActiveSpreadsheet();
var ss = SS.getActiveSheet();
var url = '';
url += SS.getUrl();
url += '#gid=';
url += ss.getSheetId();
return url;
}
function notDumb(){
var body = getSheetUrl();
var options = {}
options.htmlBody ='<a href=\"' +body+ '">Here is the File</a>';
GmailApp.createDraft("john@john.com", "Testing",'', options);
}