当有人向文件添加评论时自定义电子邮件通知

发布于 2024-11-30 07:56:04 字数 478 浏览 0 评论 0原文

我想自定义从 Plone 的默认评论操作发送的文本,尤其是当有人评论文件时发送的链接。当前的行为是链接本身启动文件。我希望看到的行为是让读者能够看到输入的评论。

我一直试图通过 ZMI 和 Zope 文件系统查找消息的模板脚本,但无法找到消息模板。


.... 默认消息示例 ....

有人在您的文件上添加了评论: 测试。

如果您是该文章的作者,我们建议您阅读评论, 并根据需要相应更新文档 - 然后删除评论。

如果需要进一步澄清,请回复评论以及负责人 发表评论将会收到这样的通知,并且可能会给您 更多细节。

要查看新评论,请访问: http://bestkey.middlewaygroup.com/products/Test.ppt

-- 站点管理员

I'd like to customize the text sent from the default Comment action of Plone, especially the link sent when someone comments on a file. Current behavior is that the link launches the file itself. The behavior I'd like to see is to take the reader to be able to see the comment entered.

I've been trying to find the template script for the message via both ZMI and the Zope file system but couldn't locate the message template.


.... Example of Default Message ....

Someone added a comment on your File:
Test.

If you are the author of this item, we recommend that you read the comment,
and update the documentation accordingly if required - then remove the comment.

If further clarification is needed, reply to the comment, and the person who
made the comment will get a notification like this, and will likely give you
more details.

To view the new comment, visit:
http://bestkey.middlewaygroup.com/products/Test.ppt

--
Site Administrator

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

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

发布评论

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

评论(2

变身佩奇 2024-12-07 07:56:04

您可能想看看 plone.app.discussion 这是新的评论系统适用于 Plone 4.1,也可作为 Plone 3.3 的附加产品。

使用 padiscussion,您可以注册一个自定义事件订阅者,该事件订阅者在添加新评论时会被触发:

<subscriber
      for="plone.app.discussion.interfaces.IComment
           zope.app.container.interfaces.IObjectAddedEvent"
      handler=".mycustomsubscriber.notify_user"
      />

您必须将“notify_user”函​​数放入“mycustomsubscriber.py”文件中,该文件可以包含发送自定义电子邮件的任意 Python 代码。

请参阅 http://svn。 plone.org/svn/plone/plone.app.discussion/trunk/plone/app/discussion/notifications.zcmlhttp://svn.plone.org例如 /svn/plone/plone.app.discussion/trunk/plone/app/discussion/comment.py

如果旧的 Plone 评论系统评论提供像 IComment 这样的接口,它应该类似地工作。虽然,我认为它没有提供这样的接口,但我不能100%确定。

You might want to have a look at plone.app.discussion which is the new commenting system for Plone 4.1 and also available as an add-on product for Plone 3.3.

With p.a.discussion you can register a custom event subscriber that is fired when a new comment is added:

<subscriber
      for="plone.app.discussion.interfaces.IComment
           zope.app.container.interfaces.IObjectAddedEvent"
      handler=".mycustomsubscriber.notify_user"
      />

You have to put a "notify_user" function inside a "mycustomsubscriber.py" file which can contain arbitrary Python code that sends a custom email.

See http://svn.plone.org/svn/plone/plone.app.discussion/trunk/plone/app/discussion/notifications.zcml and http://svn.plone.org/svn/plone/plone.app.discussion/trunk/plone/app/discussion/comment.py for examples.

If the old Plone commenting system comments provide an interface like IComment it should work similarly. Though, I think it does not provide such an interface, but I'm not 100% sure.

尽揽少女心 2024-12-07 07:56:04

您正在寻找的模块是:

  • Products.PloneHelpCenter.skins.plone_help_center.discussion_notify_template.pt

,您可以使用z3c.jbot。或者在 ZMI 中自定义:

  • portal_skins/plone_help_center/discussion_notify_template.pt

(并且,您必须至少安装一个附加组件,Products.PloneHelpCenter 因为此消息来自该加载项)。

The module you are looking for is:

  • Products.PloneHelpCenter.skins.plone_help_center.discussion_notify_template.pt

which you can override with z3c.jbot. Or in the ZMI, customize:

  • portal_skins/plone_help_center/discussion_notify_template.pt

(And, you must have at least one add-on installed, Products.PloneHelpCenter because this message is from that add-on).

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