Set PloneFormGen to send mail to a group of users

129 Views Asked by At

I have a form created with PloneFormGen and a group of users in my plone website. How to configure Mailer Adapter Recipient Expression (in myform/mailer/edit - Overrides) to send mail to this group of users?

2

There are 2 best solutions below

1
keul On BEST ANSWER

Unluckily I don't think you can use plone.api methods here as you are in the restricted python

Try something like:

python:[user.getProperty('email') for user in object.portal_groups.getGroupById('YOURGROUPID').getGroupMembers()]
1
T. Kim Nguyen On

Have a look at https://plone.org/products/collective.contentrules.mailtogroup and https://pypi.python.org/pypi/collective.groupmail though they may not be directly usable from PFG. You might have to create something intermediate that is callable from a PFG form that uses these.

I've had lots of success emailing groups of users with https://pypi.python.org/pypi/collective.easytemplate - it lets you create content rules (and pages and portlets) that contain expressions that can do almost anything.