设置 PloneFormGen 向一组用户发送邮件

Set PloneFormGen to send mail to a group of users

我在我的 plone 网站上有一个使用 PloneFormGen 和一组用户创建的表单。如何配置 Mailer Adapter Recipient Expression(在 myform/mailer/edit - Overrides 中)向该组用户发送邮件?

不幸的是,我认为您不能在此处使用 plone.api 方法,因为您处于受限 python

试试这样的东西:

python:[user.getProperty('email') for user in object.portal_groups.getGroupById('YOURGROUPID').getGroupMembers()]

看看 https://plone.org/products/collective.contentrules.mailtogroup and https://pypi.python.org/pypi/collective.groupmail 虽然它们可能不能直接从 PFG 中使用。您可能必须创建一些可从使用这些的 PFG 表单调用的中间内容。

我使用 https://pypi.python.org/pypi/collective.easytemplate 向用户组发送电子邮件取得了很多成功 - 它允许您创建包含几乎可以执行任何操作的表达式的内容规则(以及页面和 portlet)。