Slack Content Rules Action
Contents
Slack Content Rules Action#
contentrules.slack is a package providing a Plone content rules action to post a message on a Slack channel.
Contents#
About#
contentrules.slack is a package providing a Plone content rules action to post a message on Slack.
Code Health#
Installation#
Add contentrules.slack to the Plone installation using pip
:
pip install contentrules.slack
or add it as a dependency on your package's setup.py
install_requires = [
"contentrules.slack",
"Plone",
"plone.restapi",
"setuptools",
],
Start Plone and activate the plugin in the addons control-panel.
Translations#
This product has been translated into:
English (Érico Andrei)
Português do Brasil (Rudá Porto)
Deutsch (Yael Biran)
Español (Álvaro Hurtado Mochón)
License#
The project is licensed under the GPLv2.
One Last Thing#
Originally Made in Berlin, with love, by your friends @ Briefy and Pendect.
Now maintained by the Plone Collective
Usage#
Content rules action to post a message on Slack.
Using Volto#
Go to the Site Setup, then click on Content Rules.

Click on Add content rule and a form to create a new content rule will be displayed.
We are going to create a content rule to report every time an user logs in to a Plone portal.

After saving the form, it will be possible to configure the conditions and actions of this content rule.
For this example we will only add an action to Post a message to Slack, select this option and click Add

This will bring a form to configure the content rule action.

Here is a breakdown of how fields setting in this form will affect the message on Slack.

It is possible to use variables on some fields, as displayed here.

Saving the action form, will bring us back to the content rule configuration.

Now, apply this rule to the whole site.
The next user login will sent a message on the Slack channel.

Using Classic UI#
Go to the Site Setup, then click on Content Rules.

Click on Add content rule and a form to create a new content rule will be displayed.
We are going to create a content rule to report every time an user logs in to a Plone portal.

After saving the form, it will be possible to configure the conditions and actions of this content rule.
For this example we will only add an action to Post a message to Slack, select this option and click Add

This will bring a form to configure the content rule action.

Here is a breakdown of how fields setting in this form will affect the message on Slack.

It is possible to use variables on some fields, as displayed here.

Saving the action form, will bring us back to the content rule configuration.

Now, apply this rule to the whole site.
The next user login will sent a message on the Slack channel.

Contributing#
If you want to help with the development (improvement, update, bug-fixing, ...) of contentrules.slack
this is a great idea!
We appreciate any contribution and if a release is needed to be done on PyPI, please just contact one of us.
Development#
You need a working python
environment (system, virtualenv, pyenv, etc) version 3.7 or superior.
Then install the dependencies and a development instance using:
make build
To run tests for this package:
make test
By default we use the latest Plone version in the 6.x series.
Changelog#
2.0.0 (2023-02-07)#
Use
pytest
instead ofunittest
[ericof]Drop dependency on
ftw.slacker
[ericof]Drop support to Plone 5.2 [ericof]
Support to Plone 6.0, Python 3.8 to 2.11 [ericof]
Update documentation [ericof]
1.0.1 (2020-04-25)#
Fix "TypeError: expected string or bytes-like object" when one attribute of action is not set. [ericof]
1.0.0 (2019-11-28)#
Add Plone 5.2 / Python 3 support. [ericof]
Drop Python 2.7 support. [ericof]
1.0.0a1 (2017-10-17)#
Initial release. [ericof]