I apologize if this is a no-brainer question...none of my searches have found answers that are on-point. I am trying to use fields from a fetched entity as a token in a direct input field of a rule action.
The rule I'm constructing is an email rule that emails license keys to customers who have made online purchases. I have a license key table that is related to orders, and I have defined that table as an entity through the entity API.
When the purchase event triggers, I have specified an "entity exists by property condition." The condition makes sure that there is an instance of my custom entity that's related to the order id in question.
Two actions result when that condition is met. First there's a "fetch entity by property." I fetch my custom entity by the related orderid value. Second, there's a "send mail" action. In the body of that email, I would like to include a token representing a field value of the fetched entity. I can do this if I set the email body to "data selector." The selector allows gives me the option [entity-fetched:0:desired_field]. This produces an email with a body that contains the data from the desired field.
Now, here's the issue. In an email body, you never just want one piece of data. You want a direct input scenario, where you can enter message text and tokens for variable fields. When I switch from data selector to direct input, and try to use [entity-fetched:0:desired_field] as a token, the resulting email does not interpret it as a token. It merely shows me the literal text "[entity-fetched:0:desired_field]".
It feels like I am so frustratingly close, and this must be a common problem. But I cannot find any answers on the issue. What am I doing wrong?