Let your users to be notified about the content they are interested in.

An user creates a subscription and manages his/hers subscriptions (in /@@manage_subscriptions form).

An example subscription is "notify me on new content created that is tagged ..." (which includes both new content with interest tag, or old content that gets the interest tag), "notify me on any changes that affect content with interest tag".
Add eea.notifications
in your buildout.
Don't forget to Activate it.
Also activate eea.rabbitmq.plone
else you will receive KeyError: 'Interface eea.rabbitmq.plone.rabbitmq.IRabbitMQClientSettings defines a field username, for which there is no record.'
when trying to set RabbitMQ.
This means in /@@rules-controlpanel you will add a rule for each case. Examples: when an object is added, or modified, or removed...

the performed action is Ping RMQ.
Why a ping based on a content rule? The site administrator can decide for which content types this notification mechanism applies, thus applying a “sane default” for the users.
You can choose to send email notifications. In this case you will set a content rule with Event trigger: EEA Notifications: send notification event and this details:

In email notification you can use the substitution variables:

Get IP:
$ docker inspect 8b51d27e0306 | grep "IPAddress" 4016ms Mon 27 Aug 2018 12:08:18 PM EEST
"SecondaryIPAddresses": null,
"IPAddress": "",
"IPAddress": "172.26.0.2"
Instead of 8b51d27e0306 you will use the ID of rabbitmq docker container.
An asynchronous script will process the pings (retrieve them from RabbitMQ) in order to send notification for all subscribed users in that case (tag + action).
$ bin/zeo_client run bin/notifications_center
Add in buildout.cfg:
parts +=
test
[test]
recipe = zc.recipe.testrunner
defaults = ['--auto-color', '--auto-progress']
eggs =
eea.notifications [test]
plone.testing [test]
plone.app.testing [test]
Run the tests using:
./bin/test -s eea.notifications
Learn more: https://docs.plone.org/4/en/manage/deploying/testing_tuning/testing_and_debugging/unit_testing.html
Add in your docker-compose:
postfix:
image: eaudeweb/mailtrap
ports:
- "8081:80"
In mail settings (@@mail-controlpanel): SMTP server: postfix SMTP port: 25
then http://localhost:8081 u: mailtrap p: mailtrap
In your docker-compose:
rabbitmq:
image: rabbitmq:3-management
hostname: eea-rabbit
restart: always
ports:
- 5672:5672 # port for the daemon API, can be exposed to public.
- 15672:15672 # port for the Management interface
env_file:
- .secret
volumes:
- /etc/localtime:/etc/localtime:ro
volumes_from:
- rabbitmqdata
rabbitmqdata:
image: busybox
tty: true
command: chown -v -R 999:999 /var/lib/rabbitmq
volumes:
- /var/lib/rabbitmq
stdin_open: true
In your secret file:
RABBITMQ_DEFAULT_USER=admin
RABBITMQ_DEFAULT_PASS=admin
(^ Probably just to skip some errors. I don't use it.)
Then: http://0.0.0.0:15672 u: guest p: guest
When we edit a folder with title "Nice folder title here" tagged with "Austria" tag, the RabbitMQ receive a ping with related details.

Then the notification center will search the users subscribed to this type of notifications and it will send the notifications to users.

Latest source code (Plone 4 compatible): https://github.com/eea/eea.notifications/
The Initial Owner of the Original Code is European Environment Agency (EEA). All Rights Reserved.
More details: LICENSE file.