2

I've got an e-mail message with the following contents:

Dear [receiver:name],

[sender:name] would like to recommend the following link [node:url].

Now, I could certainly implement hook_tokens() and make sure that all 'receiver' and 'sender' tokens are replaced, but these entities are plain old 'user' objects. It would be great if I could just use the functionality already available, but as far as I can see, that requires me to specify replacement patterns in the format [user:name]. However, that doesn't work as it would mix up the sender and receiver.

Any idea if this is doable withouth having to reimplement the 'user' replacement logic?

0

I don't think you can do what you require as the data fed to [user:name] belongs to the currently logged in user. Sender and receiver would be different objects in your database.

| 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.