0

I've created a rule that sends a push notification to a specific user when a certain content type node is published. That said, in order to specify which user receives the notification, the 'Send Push Notification to Specific User' rule requires that I type in an existing uid.

That said, I've pulled an integer from a content type field, and I want to set that integer as the uid to send the notification to (as the user receiving a notification changes often). Naturally, Drupal won't let me do that, even after I convert the retrieved string (numeral, e.g. 7) to an integer.

Is it possible to achieve this? I'm stumped.

1
1

You have to fetch the User entity by ID using the value from the content type field without any conversion.
Then in the "Send Push Notification to Specific User" rule, you can use the ID from the fetched entity.
Not sure why you can't use the variable directly, but this is the case.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.