From 764dde48dc49777fb4cdd806218cee1d328a0c3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20L=C3=B3pez?= Date: Fri, 12 Jun 2020 11:30:13 +0200 Subject: [PATCH] Integrate with rules in D8 release #83 --- .../RulesAction/MessageNotifySendAuthor.php | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 src/Plugin/RulesAction/MessageNotifySendAuthor.php 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); + } + +}