Google上下文电子邮件小工具无效

时间:2012-01-06 20:19:21

标签: gmail-contextual-gadgets

我正在尝试创建一个内部上下文小工具,它将从gov消息的主题或正文中提取电子邮件地址。

我修改了开发者指南中的Hello World示例,并使用了支持的google.com:EmailAddressExtractor。

小工具不起作用。

我很感激有关Gadget和Manifest代码的任何建议。

还可以在mtrott.com/_Gadgets/emManifest.xml和mtrott.com/_Gadets/emGadget.xml上看到完整的清单和小工具代码

感谢您的帮助

马福

GADGET

<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="Client Email Address">
<!-- Matches and echoes Clients email address string in emails
File: emGadget.xml
Author: Marv Trott
Created: 01/01/12
Modified:  -->

<!-- Declare feature dependencies. -->

    <!-- The next feature, google.contentmatch, is required for all
 Gmail contextual gadgets.
 <Param> - specify one or more comma-separated extractor IDs in
 a param named "extractors". This line is overridden by the extractor ID
 in the manifest, but is still expected to be present. -->
<Require feature="google.contentmatch">
  <Param name="extractors">
    google.com:EmailAddressExtractor
  </Param>
</Require>

</ModulePrefs>

<!-- Define the content type and display location. The settings
"html" and "card" are required for all Gmail contextual gadgets. -->
<Content type="html" view="card">
<![CDATA[
  <script type="text/javascript">
    <!-- Fetch the array of content matches. -->
    matches = google.contentmatch.getContentMatches();
    var matchList = document.createElement('UL');
    var listItem;
    var extractedText;

    <!-- Iterate through the array and display output for each match. -->
    for (var match in matches) {
      for (var key in matches[match]) {
        listItem = document.createElement('LI');
        extractedText = document.createTextNode(key + ": " + matches[match][key]);
        listItem.appendChild(extractedText);
        matchList.appendChild(listItem);
      }
    }
    document.body.appendChild(matchList);
   </script>
]]>
</Content>
</Module>

清单

<?xml version="1.0" encoding="UTF-8" ?>
<ApplicationManifest xmlns="http://schemas.google.com/ApplicationManifest/2009">
<!-- Matches and echoes Clients email address string in Subject or Body of emails
File: emManifest.xml
Author: Marv Trott
Created: 01/01/12
Modified:  -->

<!-- Support info to show in the marketplace & control panel -->

<!-- Name and description pulled from message bundles -->
<Name>ClientEmailAddress</Name>
<Description>A Gmail contextual gadget to pull the Clients email address from the Subject or Body of the message </Description>

<!-- Show this link in Google's universal navigation for all users -->
<Extension id="navLink" type="link">
<Name>EmailGadget</Name>
<Url>http://mtrott.com/index.html?from=google&amp;domain=${DOMAIN_NAME}</Url>
</Extension>

<!-- Declare our OpenID realm so our app is white listed -->
<Extension id="realm" type="openIdRealm">
<Url>http://mtrott.com</Url>
</Extension>

<!-- EXTRACTOR -->
<Extension id="EmailAddressExtractor" type="contextExtractor">
<Name>Client Email Address</Name>
<Url>google.com:EmailAddressExtractor</Url>
<Triggers ref="emGadget"/>
<Scope ref="emailSubject"/>
<Scope ref="emailBody"/>
<Container name="mail"/>
</Extension>

<!-- GADGET -->

<Extension id="emGadget" type="gadget">
<Name>Client Email Address Gadget</Name>
<Url>http://mtrott.com/_Gadgets/emGadget.xml</Url>
<Container name="mail"/>

</Extension>

<!-- SCOPE -->

<Scope id="emailSubject">
<Url>tag:google.com,2010:auth/contextual/extractor/SUBJECT</Url>
<Reason>This application searches the Subject: line of each email for the text "*@.*"</Reason>
</Scope>

<Scope id="emailBody">
<Url>tag:google.com,2010:auth/contextual/extractor/BODY</Url>
<Reason>This application searches the message body of each email for the text "*@.*"</Reason>
</Scope>

</ApplicationManifest>

0 个答案:

没有答案