Gmail上下文小工具recipientToScope未被传递

时间:2014-02-14 21:58:49

标签: gmail-contextual-gadgets

在我的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可以访问该值。但它从未在那里显示收件人(“收件人”)的电子邮件地址。

之前有人遇到此问题,并有任何提示吗?

1 个答案:

答案 0 :(得分:0)

我想我解决了它。

此:

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

......必须是:

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

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