电子邮件跟踪器 - 可以使用,但是否可以在 Gmail 客户端中显示问号图标以外的其他内容?

问题描述 投票:0回答:1

从多年前的StackOverflow 帖子中的答案中汲取灵感,我使用 Google Sheets 成功创建了电子邮件跟踪器图像。它在功能上可以跟踪,但它显示一个 [?] 图标而不是我试图让它显示的图像。

我只需将从 html

<img src="https://script.google.com/macros/s/AKfycbyRRnH5iALMqMlgMs3QiWcdI3LiXgLXBtYTGNVBppmsKi_7-0An5PTmrSt0JYLT7m5g/exec?src=CodePen" />
生成的图像复制并粘贴到电子邮件中,我就可以成功跟踪电子邮件何时被打开到我的 Google 表格中 Question mark icon that displays Google sheet entry showing tracked email opened

这是我使用的 AppScript 代码,因此您也可以对其进行测试,这是 CodePen,我可以从中将渲染的电子邮件跟踪器图像复制到我的 Gmail 撰写邮件中

我希望能够发送实际图像而不是 [?]

如果您使用此代码

<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=="/>
,浏览器将显示一个红点,因此我尝试让 GET API 调用以文本形式返回该
date...==
值,认为 HTML 会拾取它,但事实并非如此工作也可以。有什么想法吗?

更新1:

我改进了问题的主体以减少混乱。根据评论,我尝试使用 this 方法 更新我的 AppScript,以使用图像 url 以及我上面共享的 SVG

data...==
对象返回 HTML 对象,但都不起作用,我仍然收到 [? ] 并进行 GET API 调用现在会在 Postman 中返回此内容

<!doctype html>
<html>

<head>
    <meta name="chromevox" content-script="no">
    <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"
        nonce="VO2qwIJjLxZif_nTwjioww">
    <link rel="stylesheet" href="/static/macros/client/css/2972996970-mae_html_css_ltr.css">
    <script type="text/javascript" src="/static/macros/client/js/4136683848-warden_bin_i18n_warden.js"></script>
</head>

<body>
    <table id="warning-bar-table" class="full_size" cellspacing="0" cellpadding="0">
        <tr>
            <td>
                <div id="warning" class="warning-bar"></div>
            </td>
        </tr>
        <tr>
            <td style="height: 100%"><iframe id="sandboxFrame"
                    allow="accelerometer *; ambient-light-sensor *; autoplay *; camera *; clipboard-read *; clipboard-write *; encrypted-media *; fullscreen *; geolocation *; gyroscope *; magnetometer *; microphone *; midi *; payment *; picture-in-picture *; screen-wake-lock *; speaker *; sync-xhr *; usb *; web-share *; vibrate *; vr *"
                    sandbox="allow-downloads allow-forms allow-modals allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-top-navigation-by-user-activation allow-storage-access-by-user-activation">
                </iframe>
            </td>
        </tr>
    </table>
    <script nonce="0SAAOkgbuqtmkYBmeBotjA">
        (function() {
var el = document.getElementById('sandboxFrame');
el.onload = function() {
goog.script.init("\x7b\x22functionNames\x22:\x5b\x22doPost\x22,\x22doGet\x22,\x22processResult\x22,\x22processRequest\x22,\x22test\x22,\x22testGet\x22\x5d,\x22sandboxMode\x22:\x22IFRAME_SANDBOX\x22,\x22callbackTimeout\x22:390000,\x22deploymentId\x22:\x22AKfycbyV9pX-2IejSGmic_bxCcm-uAGehnB5HoqPdLloyv0nnjf2Kw5zWbfHntJEFd0LGM2P\x22,\x22eei\x22:\x22\x22,\x22sandboxHost\x22:\x22https:\/\/n-hsuo5icdlgt7jj4tkbxzfgmypt6kltl2howxigy-0lu-script.googleusercontent.com\x22,\x22clientSideProperties\x22:\x7b\x22google.script.sandbox.mode\x22:\x22IFRAME_SANDBOX\x22,\x22google.script.host.origin\x22:\x22https:\/\/docs.google.com\x22\x7d,\x22actionPrefix\x22:\x22\/macros\/s\/AKfycbyV9pX-2IejSGmic_bxCcm-uAGehnB5HoqPdLloyv0nnjf2Kw5zWbfHntJEFd0LGM2P\x22,\x22userHtml\x22:\x22\x3cimg src \x3d \\\x22https:\/\/deafassistant.com\/images\/logo-dark.png\\\x22\x3e\x22,\x22ncc\x22:\x22\x7b\\\x22awhs\\\x22:true\x7d\x22\x7d", "", undefined, true , false  , "false", "https:\/\/n-hsuo5icdlgt7jj4tkbxzfgmypt6kltl2howxigy-0lu-script.googleusercontent.com", "\/\/drive.google.com\/abuse?id\x3dAKkXjoyWDgnsm9PsAF_BuBBvs0iOEeCXFbzzoMzKOqvAqAHlCbFd9J-o-WpTmnhuQ86AXAeDF6ywqfnS-O0oRRwHFebQx4ydYFg5B6fX%3A0");}
el.src = 'https:\/\/n-hsuo5icdlgt7jj4tkbxzfgmypt6kltl2howxigy-0lu-script.googleusercontent.com\/userCodeAppPanel';
}());
    </script>
</body>

</html>
html image email google-sheets analytics
1个回答
0
投票

如果您无法创建返回图像的代理,请尝试此操作,该代理可能会或可能不会被电子邮件客户端加载

<img height="1" width="1" style="visibility:hidden" 
src="https://script.google.com/macros/s/AKfycbyRRnH5iALMqMlgMs3QiWcdI3LiXgLXBtYTGNVBppmsKi_7-0An5PTmrSt0JYLT7m5g/exec?src=CodePen" />

实际代理的替代方法是使用 mod rewrite

https://httpd.apache.org/docs/2.2/rewrite/proxy.html

© www.soinside.com 2019 - 2024. All rights reserved.