Discussions

Use of tokens in Emails

Hi! Just wondering, if I want to use tokens from the list that is at the bottom of the page, some of them are not converted. Do I have to make sure to turn on some other parameter somewhere ?

Example: I want to use the phone number field from my user profile.

Tx

Posted: Mar 15, 2013

Comments

Francois P on March 17, 2013

Hi all!

I've been doing research and it seems that I'm not the only one with this problem. In the different discussions I saw, it is mentioned that you have to have the right modules installed, etc.

From there, I drew some thoughts that I want to share with you and see if it's feasible.
Main problem is, the fact that aside the tokens belonging to order not much else gets converted. In my research I noticed that when I use the Devel module, it has a built-in function or code that can show you the values of all tokens in a page. What I suggest is this. Could it be possible to use that function or code snippet. Put it somehow in a filter that could be triggered in in one of the Text Format. Ex : Commerce Order Message. That way, I would believe that all site wide tokens would be available for interpretation and it would be great for customizing these email templates.

Soo. Does this make sense? What do you guys think?

thridda on May 11, 2013

I had similar issues recently. At first I was puzzled because I had included in my rule to check for the entity has field of the types I was trying to insert into the email. I found that after reading more carefully the long list of tokens that In some cases I had tokens with underscores and some with dashes. It seems like the underscore versions were the entities and were unformatted. The dashed versions required that I specify the additional selection in order to output content. So [node:mailing-address:postal_code] for example. Make sure to read the descriptions of the tokens and include the additional selectors on those tokens. I'm not clear why sometimes it seemed that the entity versions wouldn't output as expected, but that might have been user error on my part at the time.