EasyNewsletter is a simple but powerful newsletter/mailing product for Plone.
- Support Text and HTML Newsletter (including images)
- Support manual written Newsletters/Mailings
- Plonish (can use Plone’s Collections to collect content)
- Variable templates to generate newsletter content
- Subscribing / Unsubscribing and can use Plone Members/Groups as receivers (works also with Membrane)
- support for external subscriber sources (configured through a Zope utility)
- support for external delivery services (other than Plone MailHost)
- TTW customizeable output Template to generate nice HTML Newsletter
- Support personalized mails
- mass import/export subscribers via csv
- support external filtering/manipulation (filter out or add more subscribers) plugins
- [inqbus.plone.fastmemberproperties] speed up access of member properties (optional, you can installed it with Products.EasyNewsletter[all] in your buidlout eggs list)
Plone 3.X (tested) or 4.X (tested)
- Add Products.EasyNewsletter to your buildout
- Run your buildout script
- Restart Zope
- Install EasyNewsletter via Plone Management Interface
- Add an “Newsletter Subscriber” portlet and select the EasyNewsletter (To this newsletter the subscribers will be added).
You can use EasyNewsletter to manually create mailings/newsletters or you can use the collection criteria to collect content.
EasyNewsletter is heavily based on Plone’s Collections. In fact, the Newsletter as well as the Issues are actually specialized Collections.
Hence you can use familiar criteria to decide which content should be part of a newsletter.
It’s a feature of Collections that subtopics are able to inherit criteria from its parent, so all Issue instances are able to inherit criteria from the outer Newsletter instance.
Plone’s default feature of subtopics is used to create sections within the newsletter issue. For example one can create two sections - news and events - by creating subtopics which collect just this kind of content objects.
Once the content is generated one can edit the text as usual in Plone.
You can create your own templates to structure the selected content. Please refer to the provided “default” template to see how it works.
If you want some elements, let’s say a logo only in mails but not in the public view, you can put it inside a div tag with a class “mailonly”. All div elements with class “mailonly” are filtered out in the public view.
EasyNewsletter provide a flexible way to filter the Plone members, Plone groups and the recivers list. You can provide smal funtion in your add-on and register it as IReceiversMemberFilter, IReceiversGroupFilter or IReceiversPostSendingFilter. The filter get the list and can filter out some entries or even add some entries.
Interface: Products.EasyNewsletter.interfaces.IReceiversMemberFilter
The IReceiversMemberFilter filters can be used to filter the list of Plone members which a user can select in newsletters and issues.
class ReceiversMemberFilterNoPloneMember(object):
""" filters all members out of newsletter receivers selection list,
which are default plone members. This is usefull if you whant
only membrane members but not the default plone user as receivers.
receivers: [(id, {'email': 'info@example.com',...})]
"""
def __init__(self, context):
self.context = context
def filter(self, receivers):
portal = getSite()
query = {}
query['portal_type'] = ['Contact',]
contacts = portal.membrane_tool.search(query)
whitelist = [contact.getUserId for contact in contacts]
receivers = [receiver for receiver in receivers
if receiver[0] in whitelist]
return receivers
This filter should be registered as follow:
<subscriber zcml:condition="installed my.package"
for="Products.EasyNewsletter.interfaces.IEasyNewsletter"
factory="my.package.newsletter.ReceiversMemberFilterNoPloneMember"
provides="Products.EasyNewsletter.interfaces.IReceiversMemberFilter" />
Interface: Products.EasyNewsletter.interfaces.IReceiversGroupFilter
The IReceiversGroupFilter filters can be used to filter the list of Plone groups which a user can select in newsletters and issues.
class ReceiversGroupFilterInactiveOrganizations(object):
""" Filter all inactive organizations, out of the group selection list.
receivers: [(id, {'email': 'info@example.com',...})]
"""
def __init__(self, context):
self.context = context
def filter(self, receivers):
portal = getSite()
query = {}
query['portal_type'] = ['Organization']
query['review_state'] = ['inactive', 'internal', 'pending', 'former_member']
inactive_groups = portal.membrane_tool.search(query)
blacklist = [black.getGroupId for black in inactive_groups]
receivers = [receiver for receiver in receivers
if receiver[0] not in blacklist]
return receivers
This filter should be registered as follow:
<subscriber zcml:condition="installed my.package"
for="Products.EasyNewsletter.interfaces.IEasyNewsletter"
factory="my.package.newsletter.ReceiversGroupFilterInactiveOrganizations"
provides="Products.EasyNewsletter.interfaces.IReceiversGroupFilter" />
Interface: Products.EasyNewsletter.interfaces.IReceiversMemberFilter
The IReceiversPostSendingFilter can be used to filter the list of reveivers before sending emails to all receivers.
class ReceiversPostSendingFilterNoNewsletter(object):
""" Filter all contacts that has not set the receive_newsletter
flag, out of receivers email list. But only if the Newsletter provide
IReceiversMemberFilterNoNewsletter.
receivers: [{'email': 'info@example.com',...}]
"""
def __init__(self, context):
self.context = context
def filter(self, receivers):
newsletter_object = self.context
if IReceiversMemberFilterNoNewsletter.providedBy(newsletter_object):
portal = getSite()
query = {}
query['portal_type'] = ['Contact']
query['getReceive_newsletter'] = False
no_enl_contacts = portal.membrane_tool.search(query)
blacklist = [black.getUserId for black in no_enl_contacts]
receivers = [receiver for receiver in receivers
if receiver['email'] not in blacklist]
return receivers
This filter should be registered as follow:
<subscriber zcml:condition="installed my.package"
for="Products.EasyNewsletter.interfaces.IEasyNewsletter"
factory="my.package.newsletter.ReceiversPostSendingFilterNoNewsletter"
provides="Products.EasyNewsletter.interfaces.IReceiversPostSendingFilter" />
An external subscriber sources provides (additional) subscriber to a newsletter instance.
You configure an external subscriber source as a Zope 3 utility providing ISubscriberSource (here’s an example where subscriptions are managed externally through MongoDB):
class NewsletterSource(object):
implements(ISubscriberSource)
def getSubscribers(self, newsletter):
""" return all subscribers for the given newsletter
from the MyInfo user database. Newsletter subscriptions
are referenced inside MyInfo through UIDs.
"""
uid = newsletter.UID()
# find MyInfo subscribers
myinfo = getUtility(IMyInfo)
subscribers = list()
for user in myinfo.accounts.find({'data.newsletters': uid, 'state': 'active'}):
subscribers.append(dict(email=user['email'], fullname=user['username']))
return subscribers
The utility must be registered using ZCML:
<utility zcml:condition="installed Products.EasyNewsletter"
name="MyInfo subscribers"
factory=".newsletter.NewsletterSource"
/>
Inside the Edit view of the instance under the External tab you should find MyInfo subscribers under the option External subscriber source.
The following placeholder can be used in the header, body and footer of Issues:
For more documentation please visit: http://packages.python.org/Products.EasyNewsletter/
In dec 2011 the source code repository was moved from svn-collective to github.
Contents: