Posted by webwriter on September 21, 2010 at 6:05pm
Is it possible to use Rules to send an email to a user referenced in the node, not the node author? I've been struggling and searching and can't find the answer or a solution.
Thanks!
Is it possible to use Rules to send an email to a user referenced in the node, not the node author? I've been struggling and searching and can't find the answer or a solution.
Thanks!
Comments
Yes, it is. I do it
Yes, it is. I do it frequently through the use of user reference CCK field in my node.
In the DO section, add the action Load a referenced user and select the user you want to load. Give it a name if you want, otherwise it will default to 'Referenced User'.
Then add another action, Send mail to a user and select the name you chose in the previous step under the Arguments configuration.
Voila! That's all it takes.
Multiple values?
And how about user reference field with multiple values?
solution for d7?
seems to me like this solution applies to drupal 6 but is not available in d7. (caution: i am not an expert!).
i found my solution by
- using the action FETCH ENTITY BY ID
- in the section ENTITY TYPE: selecting USER
- in the section IDENTIFIER>DATA SELECTOR: selecting the user referencing field of my node (in my case node:field-blogger) and furthermore selecting UID from the available options (which included status, og-memberships, roles and the cck-fields of user-entity); resulting content of data-selector: node:field-blogger:uid
- adding another action (for testing purposes: SHOW MESSAGE ON THE SITE). i now found the token ENTITY:FETCHED MAIL in the list of available tokens and inserted this token into the message box.
after saving the action i added a node (rule-event being AFTER SAVING NEW CONTENT OF TYPE BLOGTERMIN) the email-address the referenced user correctly showed up in the message box.
too complicated for me was this solution at stackoverflow
http://stackoverflow.com/questions/4463011/drupal-rules-sending-an-email...
and this discussion on do
http://drupal.org/node/1432042
regards
karl
Prevent email form being sent again if other node fields change
Thanks for this Karl; it worked for me. I used this for a translation tracking system, where translators get notified of translation they've been assigned to via entity reference. I wanted to leave open the option that the original node could be changed after the translator had been assigned, without sending another email to the translator (ie referenced user) so I added the following condition:
Data comparison (I'm using your example field for consistency)
DATA TO COMPARE: node-unchanged:field-blogger
OPERATOR: equals
DATA VALUE: node:field-blogger (what you're comparing node-changed:field-blogger to)
Check 'Negate'
This way the email only fires when the value of the referenced field changes; in my setup the vast majority f the instances are from no value to some value, but this allows other emails to be sent if a new translator is assigned.
Kindly explain for Drupal 8 version
Can u explain for more detail in Drupal 8 please
Thank you!!!
Thank you, thank you, thank you!!
That is the info I needed. I really appreciate it!! :-)
Thanks for this post! been
Thanks for this post! been looking all around for this :D
And Multivalued field?
And how about user reference field with multiple values? What are the conditions?
I would like the site to send emails to all referenced users in the field no matter of their order.
10x for the info in advance.
For multiple values field use
For multiple values field use the loop option. See instructions http://drupal.org/node/1300058.
Thank you!!!
Thank you Karl!!! You saved at 1:00 am !!!!
Need a little help.
I can't seem to get this to work with a user being referenced from a OG group content type. I have a content type the is an organic group and upon creating this content you reference a user. I want to be able to send an email to this user when the content is first saved. I tried the above method but can't for the life of me get the system message to show so I'm sure it's broke before it even gets to the point of displaying the message.
Here is what I have so far:
Event :
After saving new content
Conditions:
Content is of type
Actions:
Fetch entity by id
Value: User
Identifier: site:og-context--node:field-user-assigned:uid
(above is where I think it's broke)
Show a message on the site:
Message:
Value: [entity-fetched:mail]
Message Type:
Status
I'm going to keep messing around with it to see if I can get it to work but, if anyone on here can help that would be awesome!
Thanks
Similar Problem for URL
I had a problem trying to obtain the NodeID from URL. I did a search and found that the issue was known but no one was currently working on it. I wrote my own code to get the NID from a lookup in the url_alias table.
Fantastic!
For me it worked like a wonder, thanks Karl
Karl's Solution Works - D7
I researched for 2 days how to do this, of course it always ends up being easy.
Thanks Karl for your guide!