Utilisation de Rules avec drupal 8

Bonjour,

Je souhaite envoyer un message au utilisateur du site d'une association après création de leur compte.

Je sais qu'il y a une case à cocher "Notifier l'utilisateur de la création de son nouveau compte" dans le formulaire mais je souhaite différencier le message suivant le rôle de l'utilisateur créé.

J'ai donc installé le module "Rules".
Je l'ai utilisé il y a quelques années sur drupal 7 et cela m'avait paru relativement simple mais avec drupal 8 je bloque.

J'ai bien réussi à créer un règle se lançant lorsqu'un nouveau compte est créé mais lorsqu'il s'agit de configurer l'action à mener (envoyer un courriel), je ne comprends pas comment désigner l'email du compte créé comme destinataire du message, cf. capture d'écran : https://screenshots.firefox.com/4egcwXCDuH4NAZW1/demo.segal.bzh

J'ai essayé différentes saisies mais à chaque fois l'enregistrement d'un utilisateur génère une erreur drupal :

The website encountered an unexpected error. Please try again later.

Dans le journal, on peut lire (désolé pour la longueur ...) :

TypeError : Argument 1 passed to Drupal\rules\Plugin\RulesAction\SystemSendEmail::doExecute() must be of the type array, object given dans Drupal\rules\Plugin\RulesAction\SystemSendEmail->doExecute() (/var/www/vhosts/demo.segal.bzh/httpdocs/modules/rules/src/Plugin/RulesAction/SystemSendEmail.php ligne 112) #0 [internal function]: Drupal\rules\Plugin\RulesAction\SystemSendEmail->doExecute(Object(Drupal\Core\Field\FieldItemList), 'coucou', 'coucou', '', NULL) #1 /var/www/vhosts/demo.segal.bzh/httpdocs/modules/rules/src/Core/RulesActionBase.php(126): call_user_func_array(Array, Array) #2 /var/www/vhosts/demo.segal.bzh/httpdocs/modules/rules/src/Plugin/RulesExpression/RulesAction.php(93): Drupal\rules\Core\RulesActionBase->execute() #3 /var/www/vhosts/demo.segal.bzh/httpdocs/modules/rules/src/Plugin/RulesExpression/ActionSet.php(31): Drupal\rules\Plugin\RulesExpression\RulesAction->executeWithState(Object(Drupal\rules\Engine\ExecutionState)) #4 /var/www/vhosts/demo.segal.bzh/httpdocs/modules/rules/src/Plugin/RulesExpression/Rule.php(94): Drupal\rules\Plugin\RulesExpression\ActionSet->executeWithState(Object(Drupal\rules\Engine\ExecutionState)) #5 /var/www/vhosts/demo.segal.bzh/httpdocs/modules/rules/src/Plugin/RulesExpression/ActionSet.php(31): Drupal\rules\Plugin\RulesExpression\Rule->executeWithState(Object(Drupal\rules\Engine\ExecutionState)) #6 /var/www/vhosts/demo.segal.bzh/httpdocs/modules/rules/src/EventSubscriber/GenericEventSubscriber.php(131): Drupal\rules\Plugin\RulesExpression\ActionSet->executeWithState(Object(Drupal\rules\Engine\ExecutionState)) #7 [internal function]: Drupal\rules\EventSubscriber\GenericEventSubscriber->onRulesEvent(Object(Drupal\rules\Event\EntityEvent), 'rules_entity_in...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher)) #8 /var/www/vhosts/demo.segal.bzh/httpdocs/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func(Array, Object(Drupal\rules\Event\EntityEvent), 'rules_entity_in...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher)) #9 /var/www/vhosts/demo.segal.bzh/httpdocs/modules/rules/rules.module(124): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('rules_entity_in...', Object(Drupal\rules\Event\EntityEvent)) #10 [internal function]: rules_entity_insert(Object(Drupal\user\Entity\User)) #11 /var/www/vhosts/demo.segal.bzh/httpdocs/core/lib/Drupal/Core/Extension/ModuleHandler.php(402): call_user_func_array('rules_entity_in...', Array) #12 /var/www/vhosts/demo.segal.bzh/httpdocs/core/lib/Drupal/Core/Entity/EntityStorageBase.php(169): Drupal\Core\Extension\ModuleHandler->invokeAll('entity_insert', Array) #13 /var/www/vhosts/demo.segal.bzh/httpdocs/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(730): Drupal\Core\Entity\EntityStorageBase->invokeHook('insert', Object(Drupal\user\Entity\User)) #14 /var/www/vhosts/demo.segal.bzh/httpdocs/core/lib/Drupal/Core/Entity/EntityStorageBase.php(470): Drupal\Core\Entity\ContentEntityStorageBase->invokeHook('insert', Object(Drupal\user\Entity\User)) #15 /var/www/vhosts/demo.segal.bzh/httpdocs/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(615): Drupal\Core\Entity\EntityStorageBase->doPostSave(Object(Drupal\user\Entity\User), false) #16 /var/www/vhosts/demo.segal.bzh/httpdocs/core/lib/Drupal/Core/Entity/EntityStorageBase.php(395): Drupal\Core\Entity\ContentEntityStorageBase->doPostSave(Object(Drupal\user\Entity\User), false) #17 /var/www/vhosts/demo.segal.bzh/httpdocs/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(820): Drupal\Core\Entity\EntityStorageBase->save(Object(Drupal\user\Entity\User)) #18 /var/www/vhosts/demo.segal.bzh/httpdocs/core/lib/Drupal/Core/Entity/Entity.php(387): Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object(Drupal\user\Entity\User)) #19 /var/www/vhosts/demo.segal.bzh/httpdocs/core/modules/user/src/RegisterForm.php(94): Drupal\Core\Entity\Entity->save() #20 [internal function]: Drupal\user\RegisterForm->save(Array, Object(Drupal\Core\Form\FormState)) #21 /var/www/vhosts/demo.segal.bzh/httpdocs/core/lib/Drupal/Core/Form/FormSubmitter.php(111): call_user_func_array(Array, Array) #22 /var/www/vhosts/demo.segal.bzh/httpdocs/core/lib/Drupal/Core/Form/FormSubmitter.php(51): Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object(Drupal\Core\Form\FormState)) #23 /var/www/vhosts/demo.segal.bzh/httpdocs/core/lib/Drupal/Core/Form/FormBuilder.php(585): Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object(Drupal\Core\Form\FormState)) #24 /var/www/vhosts/demo.segal.bzh/httpdocs/core/lib/Drupal/Core/Form/FormBuilder.php(314): Drupal\Core\Form\FormBuilder->processForm('user_register_f...', Array, Object(Drupal\Core\Form\FormState)) #25 /var/www/vhosts/demo.segal.bzh/httpdocs/core/lib/Drupal/Core/Controller/FormController.php(74): Drupal\Core\Form\FormBuilder->buildForm('user_register_f...', Object(Drupal\Core\Form\FormState)) #26 [internal function]: Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch)) #27 /var/www/vhosts/demo.segal.bzh/httpdocs/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array) #28 /var/www/vhosts/demo.segal.bzh/httpdocs/core/lib/Drupal/Core/Render/Renderer.php(582): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #29 /var/www/vhosts/demo.segal.bzh/httpdocs/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #30 /var/www/vhosts/demo.segal.bzh/httpdocs/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) #31 /var/www/vhosts/demo.segal.bzh/httpdocs/vendor/symfony/http-kernel/HttpKernel.php(151): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #32 /var/www/vhosts/demo.segal.bzh/httpdocs/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #33 /var/www/vhosts/demo.segal.bzh/httpdocs/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #34 /var/www/vhosts/demo.segal.bzh/httpdocs/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #35 /var/www/vhosts/demo.segal.bzh/httpdocs/core/modules/page_cache/src/StackMiddleware/PageCache.php(99): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #36 /var/www/vhosts/demo.segal.bzh/httpdocs/core/modules/page_cache/src/StackMiddleware/PageCache.php(78): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) #37 /var/www/vhosts/demo.segal.bzh/httpdocs/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #38 /var/www/vhosts/demo.segal.bzh/httpdocs/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(50): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #39 /var/www/vhosts/demo.segal.bzh/httpdocs/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #40 /var/www/vhosts/demo.segal.bzh/httpdocs/core/lib/Drupal/Core/DrupalKernel.php(664): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #41 /var/www/vhosts/demo.segal.bzh/httpdocs/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #42 {main}.

Même problème lorsqu'il s'agit de saisir une condition.

Pour rappel, je souhaite envoyer un message différent suivant le rôle de l'utilisateur : https://screenshots.firefox.com/gAv5fxKlZBbx7y7h/demo.segal.bzh

Dans la capture ci-dessus, "adherent" est le nom système du rôle qui m'intéresse mais là encore j'ai fait pas mal d'autres tests sans succès.

Quelqu'un peut-il me donner quelques pistes ?

Je n'ai pas trouvé un tuto avec des exemples concrets d'utilisation de Rules sur drupal 8.

Peut-être une autre extension serait-elle plus simple à configurer pour faire ce que je souhaite ?

Merci d'avance de vos lumières.

Version de Drupal :