2

I have a content type called Help Wanted. I have another content type called Reply to Help Wanted. The reply content type includes an entity reference field that contains a node reference to the original help wanted ad being replied to.

I am trying to use Rules to send an e-mail when a reply is posted to the author of the original Help Wanted post.

However, I don't know what to put in the To field of the Send mail action. I tried the following:

[node:field_my_entityreference:author:mail]

But this token didn't work. I also tried several other variations to no effect. Is it possible to use tokens to get the author's e-mail of a node linked by entity reference? If not, how do I get the author's e-mail via the entity reference?

  • Hey Patrick, the above worked for me perfectly just now in a quick test. However, I used the 'direct input mode' rather than the tokens to select all the fields. Have you tried that? – Boriana Ditcheva Apr 29 '13 at 16:59
  • PHP filter module could be an option – Aboodred1 Apr 29 '13 at 17:09
  • I'm so glad it worked! I did add it... – Boriana Ditcheva Apr 29 '13 at 17:22
5

Here's how I got mine to work:

  1. Switch to 'Data selection mode' which is not how the mail action launches by default: enter image description here
  2. Select through the field sequence just like you already had with tokens! enter image description here

I noticed that the tokens are otherwise not available if you just use the direct input mode. Weird!

| improve this answer | |

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.