0

在我的 Gmail 上下文小工具中,我可以获得“发件人”地址,但不能获得“收件人”地址。

这是我从清单文件中提取的内容:

<Extension id="ex1" type="contextExtractor">
    <Name>Email Recipient</Name>
    <Url>google.com:RecipientToEmailExtractor</Url>
    <Param name="to_email" value=".*"/>
    <Triggers ref="MyGadget"/>
    <Scope ref="recipientToScope"/>
    <Container name="mail"/>
</Extension>

<Extension id="ex2" type="contextExtractor">
    <Name>Email Sender</Name>
    <Url>google.com:SenderEmailExtractor</Url>
    <Param name="sender_email" value=".*"/>
    <Triggers ref="MyGadget"/>
    <Scope ref="senderScope"/>
    <Container name="mail"/>
</Extension>

我的范围:

<Scope id="recipientToScope">
    <Url>tag:google.com,2010:auth/contextual/extractor/TO_ADDRESS</Url>
    <Reason>Extracts the To address of each email</Reason>
</Scope>

<Scope id="senderScope">
    <Url>tag:google.com,2010:auth/contextual/extractor/FROM_ADDRESS</Url>
    <Reason>Extracts the From address of each email</Reason>
</Scope>

在我的 Gmail 小工具规范文件中,我使用 type="url" 来显示小工具:

<Content type="url" href="https://mysite.com/index.php" view="card" />

我的提取器看起来像这样:

<Require feature="google.contentmatch">
    <Param name="extractors">
        google.com:SenderEmailExtractor,google.com:RecipientToEmailExtractor
    </Param>
</Require>

小工具 iframe 将其显示为源:

https://mysite.com/index.php
?container=gm
&view=card
&lang=en
&country=US
&sanitize=0
&v=748lk692ac9cad5
&rpctoken=6m5f54539a5
&libs=google.contentmatch%3Adynamic-height%3Acore%3Aauth-refresh
&parent=https%3A%2F%2Fmail.google.com%2Fa%2Fmyappsdomain.com%2Fhtml
&pid=myappsdomain.com
&mid=5
&st=e%3DAA6WCYaY5vubh897t87gyghygcilRyeq%252FivEo%252B%252BBqkpbGnn9ocC9fmLgVOVmzhXD5hX70ha9cXHC1UwIsD0ZDElClAACIfpVhHjieGnJSREZ%252B8eHCj%26c%3Dgm
#cob=%257B%2522google.com%253ASenderEmailExtractor%2522%253A%255B%257B%2522sender_email%2522%253A%2522myemail%2540gmail.com%2522%257D%255D%257D

最后一行(解码)是这样的:

{"google.com:SenderEmailExtractor":[{"sender_email":"myemail@gmail.com"}]}

因此mysite.com/index.php可以访问该值。但它永远不会在那里显示收件人(“收件人”)的电子邮件地址。

有人遇到过这种情况,有什么建议吗?

4

1 回答 1

0

我想我解决了。

这个:

<Param name="to_email" value=".*"/>

... 必须:

<Param name="recipient_to_email" value=".*"/>

现在,我通过 iFrame 源 URL 将“收件人”和“发件人”电子邮件发送到我的远程脚本。

于 2014-02-19T20:40:34.200 回答