我有一个电子邮件营销活动表,我可以在其中跟踪电子邮件状态(无论其是否打开)。但是当我复制此表时,我将不得不再次部署 web 应用程序并更新 img src 链接。我正在使用 doGet 函数来捕获跟踪像素。
有没有办法在我复制包含 Web 应用程序的工作表时自动更新?
<!DOCTYPE html>
<html>
<head>
<base target="_top">
</head>
<body>
<!-- add this img tag -->
<img src="https://script.google.com/a/verzeo.in/macros/s/AKfycbwNQXBUmr6TovUxqdkz_ZAptyJZu7ZsvncmU12L/exec?method=track&email=<?= email ?>" width="0" height="0">
Hi <?= name ?>. We are testing our beta features for email marketing.
</body>
</html>
不幸的是,你不能。原因是您无法获取绑定到另一个文件的脚本。有 this issues 要求添加该问题(点击星号 ☆ 让 Google 知道您想要这个)。
有了这个,这将是一件简单的事情,因为已经有一个 API 可以进行部署(请参阅 Apps Script API);因此您可以创建一个脚本来为您制作副本并部署绑定脚本。但在那之前,你就不走运了。
<!DOCTYPE html>
<html>
<head>
<base target="_top">
</head>
<body>
<!-- add this img tag -->
<img src="https://script.google.com/a/verzeo.in/macros/s/AKfycbwNQXBUmr6TovUxqdkz_ZAptyJZu7ZsvncmU12L/exec?method=track&email=<?= email ?>" width="0" height="0">
Hi <?= name ?>. We are testing our beta features for email marketing.
</body>
</html>