Google Contextual Email Gadget Not Working

672 views Asked by At

I'm attempting to create an inhouse Contextual Gadget that will extract the email address from the Subject or Body of a gmail message.

I modified the Hello World sample from the Developers Guide and used the supported google.com:EmailAddressExtractor.

The Gadget does not function.

I would appreciate any suggestion about the Gadget and Manifest code.

The complete manifest and gadget code can also be seen at mtrott.com/_Gadgets/emManifest.xml and mtrott.com/_Gadets/emGadget.xml

Thanks for your help

Marv

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>

MANIFEST

<?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

There are 0 answers