我想将Google文档转换为电子邮件,例如文档中的Google功能:"文件>电子邮件协作者> "将项目本身粘贴到电子邮件中" 。 我试图在html中转换文档,但css样式不是内联的:
function convertToHtml(fileId) {
var url = "https://docs.google.com/feeds/download/documents/export/Export?id="+fileId+"&exportFormat=html&format=html";
var param = {
method : "get",
headers : {"Authorization": "Bearer " + ScriptApp.getOAuthToken()},
muteHttpExceptions:true,
contentType : "text/html; charset=UTF-8"
};
var html = UrlFetchApp.fetch(url,param).getContentText();
return html;
}
我需要一个函数来在html中使用内联css转换它。
例如: 不内联:
<html>
<head>
<style> p { color: red; } </style> <link rel="stylesheet" href="style.css">
</head>
<body>
<p>Test</p>
</body>
</html>
直列:
<html>
<head></head>
<body>
<p style="color: red">Test</p>
</body>
</html>
或将Google文档转换为电子邮件的其他方式。
提前致谢