Google Contextual Email Gadget Not Working

I am trying to create an in-context gadget that will extract an email address from a Subject or Body gmail message.

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

The gadget is not working.

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

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

thanks for the 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> 

MANIFESTO

 <?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 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> 
+4
source share

Source: https://habr.com/ru/post/1389720/


All Articles