[Zope-CMF] Send email to all CMF members

Todd Graham tgraham@speakeasy.net
Sun, 2 Dec 2001 08:46:17 -0800


Thanks everyone for your replies, I was able to take the suggestions from
the list and convert it to python and add it to the newsitem_edit script.
The code looks something like

if condition to see if mail should be sent if yes excecute

for item in context.portal_membership.listMembers():
     if item.email != '':
        context.mail_newsitem(recipient=item.email, description=description)

Thanks again everyone, the portal_membership.listMembers() was the key to
it.  I'd like to get it out of the for loop and just pass one argument to
the method mail_newsitem rather than using the loop.  Good thing it's
raining today :)

Todd

----- Original Message -----
From: Robert Rottermann <robert@redcor.ch>
To: Todd Graham <tgraham@speakeasy.net>; <Zope-CMF@zope.org>
Sent: Sunday, December 02, 2001 3:09 AM
Subject: Re: [Zope-CMF] Send email to all CMF members


> Todd,
> my first example does not work,
> this one should.
> If you are using DTML the code can easily be adapted.
> Here becomes _ and / becomes a dot.
> The first line therefore becomes
> <dtml-let properties="_.portal_memberdata.propertyIds()">
>   <table ....
> Robert
>
> <table tal:define="properties here/portal_memberdata/propertyIds">
>   <tr>
>     <td tal:repeat="property properties">
>         <span tal:replace="property">email</span>
>     </td>
>   </tr>
>   <tr tal:repeat="member here/portal_membership/listMembers">
>     <td tal:content="member">
>         runyaga
>     </td>
>     <td tal:repeat="p properties">
>         <span tal:replace="python:member.getProperty(p,
> None)">runyaga@slack.com</span>
>     </td>
>   </tr>
> </table>
>
>
> ----- Original Message -----
> From: "Todd Graham" <tgraham@speakeasy.net>
> To: <Zope-CMF@zope.org>
> Sent: Sunday, December 02, 2001 6:13 AM
> Subject: [Zope-CMF] Send email to all CMF members
>
>
> > Hello all,
> >
> > I've been searching trough the archives and trying to figure out how to
> send
> > email to cmf members when a new news item is added.  I've got the email
> > functionality working, I just don't now how to return a list of member's
> > email addresses.
> >
> > Thanks in advance.
> >
> > Todd
> >
> >
> > _______________________________________________
> > Zope-CMF maillist  -  Zope-CMF@zope.org
> > http://lists.zope.org/mailman/listinfo/zope-cmf
> >
> > See http://www.zope.org/Products/PTK/Tracker for bug reports and feature
> requests
> >
>
>
> _______________________________________________
> Zope-CMF maillist  -  Zope-CMF@zope.org
> http://lists.zope.org/mailman/listinfo/zope-cmf
>
> See http://www.zope.org/Products/PTK/Tracker for bug reports and feature
requests
>