I’m working on a Drupal 8 site, trying to add a rule to send an email when a user with a certain role creates a certain kind of content. Basically a Broker uploads a file and submits it, and that’s all they can do. These are created against a content type of medical_record.
I’ve tried @node.node_route_context:node, and then check for a content type of medical_record. When the rule is executed, this makes an error of:
Unable to get variable medical_record, it is not defined.
But then when I go back and fiddle with it, the Rules maker won’t even allow it, it says:
Data selector medical_record for context Content types is invalid. Unable to get variable medical_record, it is not defined.
And then I get a similar error if I switch to making the condition User Has Role(s). I try @user.current_user_context:current_user with broker, and get:
Data selector broker for context Roles is invalid. Unable to get variable broker, it is not defined.
Then I tried @user.current_user_context:current_user.roles.broker, and it won’t allow that either.
So how are roles and content types supposed to be specified?