无法使用 Gmail 自定义提取器获取发件人姓名

发布于 2024-11-27 23:02:58 字数 2013 浏览 1 评论 0 原文

对不起我的英语。我无法使用自定义提取器获取发件人姓名。我试图从“from_email”和“body”部分获取全部数据(用于测试目的)。结果中只有电子邮件。正文没有“From”部分,只有“Data”部分。

这是我的提取器:

<?xml version="1.0" encoding="UTF-8"?> 
<OpenCOBData id="SenderName">  
 <ExtractorSpec platform="gmail" language="en"> 

 <Search input_type="text"> 
 <Pattern input_fields="from_email,body"> 
 <![CDATA[(?P<sender_name>.*)]]> 
 </Pattern> 
 </Search> 

 <Response platform="gmail" format="cardgadget">
 <Output name="senderName">{@sender_name}</Output> 
 </Response> 
 </ExtractorSpec> 

</OpenCOBData>

这是清单的一部分:

<!-- EXTRACTOR --> 

<Extension id="EmailSenderNameExtractor" type="contextExtractor"> 
<Name>Email Sender Name Extractor</Name> 
<Url>781689580671:SenderName</Url> 
<Triggers ref="CustomExtractorGadget"/> 
<Scope ref="emailSenderAddress"/> 
<Scope ref="emailSenderName"/> 
<Scope ref="emailBody"/> 
<Container name="mail"/> 
</Extension> 


<!-- GADGET --> 

<Extension id="CustomExtractorGadget" type="gadget"> 
<Name>Person name extractor</Name> 
<Url>***</Url> 
<Container name="mail"/> 
</Extension> 


<!-- SCOPE --> 

<Scope id="emailSenderAddress"> 
<Url>tag:google.com,2010:auth/contextual/extractor/FROM_ADDRESS</Url> 
<Reason>This application searches the message body for any text.</Reason> 
</Scope> 

<Scope id="emailSenderName"> 
<Url>tag:google.com,2010:auth/contextual/extractor/FROM_PERSONAL</Url> 
<Reason>This application searches the message body for any text.</Reason> 
</Scope> 

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

出了什么问题?

Sorry for my English. I can't obtain sender name using custom extractor. I'm trying to get the whole data (for testing purposes) from "from_email" and "body" sections. There is only email in result. The body is without "From" section, only "Data" section.

Here is my extractor:

<?xml version="1.0" encoding="UTF-8"?> 
<OpenCOBData id="SenderName">  
 <ExtractorSpec platform="gmail" language="en"> 

 <Search input_type="text"> 
 <Pattern input_fields="from_email,body"> 
 <![CDATA[(?P<sender_name>.*)]]> 
 </Pattern> 
 </Search> 

 <Response platform="gmail" format="cardgadget">
 <Output name="senderName">{@sender_name}</Output> 
 </Response> 
 </ExtractorSpec> 

</OpenCOBData>

And here is the part of the manifest:

<!-- EXTRACTOR --> 

<Extension id="EmailSenderNameExtractor" type="contextExtractor"> 
<Name>Email Sender Name Extractor</Name> 
<Url>781689580671:SenderName</Url> 
<Triggers ref="CustomExtractorGadget"/> 
<Scope ref="emailSenderAddress"/> 
<Scope ref="emailSenderName"/> 
<Scope ref="emailBody"/> 
<Container name="mail"/> 
</Extension> 


<!-- GADGET --> 

<Extension id="CustomExtractorGadget" type="gadget"> 
<Name>Person name extractor</Name> 
<Url>***</Url> 
<Container name="mail"/> 
</Extension> 


<!-- SCOPE --> 

<Scope id="emailSenderAddress"> 
<Url>tag:google.com,2010:auth/contextual/extractor/FROM_ADDRESS</Url> 
<Reason>This application searches the message body for any text.</Reason> 
</Scope> 

<Scope id="emailSenderName"> 
<Url>tag:google.com,2010:auth/contextual/extractor/FROM_PERSONAL</Url> 
<Reason>This application searches the message body for any text.</Reason> 
</Scope> 

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

What is wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

執念 2024-12-04 23:02:58

解决方案是使用内置变量 __FROM_PERSONAL__

<Response platform="gmail" format="cardgadget">
    <Output name="senderName">{@__FROM_PERSONAL__}</Output>
    <Output name="senderEmail">{@__FROM_ADDRESS__}</Output>
</Response>

更多:http://code.google.com/intl/ru/googleapps/support/gadgets/?place=topic%2Fgoogle-apps-gadgets-api%2FlyE8Se0WhGM%2Fdiscussion

The solution is to use the built-in variable __FROM_PERSONAL__:

<Response platform="gmail" format="cardgadget">
    <Output name="senderName">{@__FROM_PERSONAL__}</Output>
    <Output name="senderEmail">{@__FROM_ADDRESS__}</Output>
</Response>

More: http://code.google.com/intl/ru/googleapps/support/gadgets/?place=topic%2Fgoogle-apps-gadgets-api%2FlyE8Se0WhGM%2Fdiscussion

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文