Nuxeo mailing list archives
[CPS-users] Re: A mail to all with an account on the site
Olivier Grisel
ogrisel at nuxeo.com
Fri Jun 16 12:27:12 CEST 2006
POLCHER Jan a écrit :
>
> Before you could go to your document and "send a mail notification" to
> all. There were problems with the SMTP servers who did not like e-mails
> with more than 50 addressees. Now under 3.4 you can not send a mail
> notification to the readers of a document anymore.
You need to install the CPS Subscriptions profile in portal_setup.
CPSSubscriptions is now optional in CPS 3.4.
> So is there a way to send a mail to all from within CPS or do I have to
> extract all e-mails from CPS first and then do it with a simple mailer ?
> If it is the second option how can I simply extract the list of e-mails ?
>
> Sorry for the long question but it seems such a trivial task to me and I
> can not see why I can not do it !
Something along those lines should do (not tested):
<quote>
from Products.CMFCore.utils import getToolByName
def getAllEmails(self):
dtool = getToolByName(self, 'portal_directories')
aclu = getToolByName(self, 'acl_users')
mdir = dtool[aclu.users_dir]
results = mdir.searchEntries(return_fields=['email'])
return ', '.join(info.get('email') for _, info in results)
</quote>
Code to be written in some external method for instance.
--
Olivier
More information about the cps-users
mailing list
This list archive provided by Nuxeo, the
leaders of open source ECM.
Check out the Nuxeo 5 open source,
standards-based ECM project.