diff --git a/src/Plugin/RulesAction/MessageNotifySendAuthor.php b/src/Plugin/RulesAction/MessageNotifySendAuthor.php new file mode 100644 index 0000000..c90287e --- /dev/null +++ b/src/Plugin/RulesAction/MessageNotifySendAuthor.php @@ -0,0 +1,78 @@ +messageNotifier = $message_notifier; + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { + return new static( + $configuration, + $plugin_id, + $plugin_definition, + $container->get('message_notify.sender') + ); + } + + /** + * Executes the action with the given context. + * + * @param \Drupal\message\MessageInterface $message + * The node to modify. + */ + protected function doExecute(MessageInterface $message) { + // Send message to message creator. + $this->messageNotifier->send($message); + } + +}