Closed andergmartins closed 5 months ago
Related issue publishpress/PublishPress-Future#342
I suggest implementing this in a new module in the Pro plugin only, keeping the current notification workflow as it is. That makes it easier to keep backward compatibility for current users and adds value to the Pro. For Pro users we could have a method to convert current notification workflows into this new workflow system allowing them to deactivate the legacy notification module. For new installations, the "Improved Notifications" module could be deactivated for new installations at least.
Another advantage is that this new module would replace the notifications module and remove the dependency of the older notifications module. I suggest implementing this as a fully independent module.
Later, for avoiding duplicated code, some code from both modules could be merged into a new notification library that can be used on both free and pro plugins, adding dependency to the library and not to the legacy notifications module itself.
I see this new feature as a base for having the PublishPress plugin as a hub for integration all the other plugins. Each plugin can reuse its notifications, calendar, etc... and provide triggers, fitlers, actions, that could be used in the custom workflows.
In order to make easier to users to understand the workflow system, we can provide a way to download something like "recipes" for notifications, or integration to the plugins. The user can then customize them on the way they want.
We decided to not implement this on PublishPress Planner, but in the Future plugin instead. I'm moving it to the correct repo.
This issue after fixed might cover a lot of feature requests in discussion, usually related to customized or very specific use cases.
Related to #348
We already have a good workflow system for notifications. But we could use part of the structure that runs it as a base for a more generic workflow system, doing more than just notifications. We basically need new triggers for the workflow
Notifications would be converted to an action that is optional, alongside other actions like changing metadata, creating posts, sending an email, sending Slack message, moving posts to specific statuses, delete posts/taxonomies, add/remove taxonomy, add capabilities to user or roles, integration with 3rd party plugins or with our own plugins, etc.
This is just the basic idea. I will add more details later if we decide to go in this direction. There are some plugins that do a similar job:
https://wordpress.org/plugins/uncanny-automator/ https://wordpress.org/plugins/automatorwp/
But they lack some filter options that we already implemented that could be very useful and are not focused on publishing content.
This opens a lot of opportunities for automating the publishing workflows and fits very well on our plugin. We can have a very intuitive UI that would help to simplify the workflow creation.
Current notification workflows can be converted into this new workflow system.
The workflows should be "cached" or compiled into scripts saved into files to avoid running too many DB queries and slowing down the site.