0
votes

How can I use [] tokens in my code?

I've seen rules modules allow using these [] tokens. They will be rendered or displayed properly even [account:roles] is an array in the email message. It's quite useful when I don't care the presentation as long as I can see the data.

[account:uid]
[account:name]
[account:mail]
[account:roles]
[account:status]

So if in my code I want to use these token to send an email instead of using the $account object. Is there a function allow me to use these tokens?

1
Token use $account object , it able to simplify usage You can use token_replace and specify entity to use api.drupal.org/api/drupal/includes%21token.inc/function/… - Fky

1 Answers