2

I have created a rule for a client that triggers an HTML email to them every time an authenticated site visitor downloads one of their PDF brochures.

I have no problem including things such as the username, email address, filename and other info, but the client wants to have the "vertical" of the PDF displaying as additional information on the outgoing email.

The PDF's are uploaded as a unique content type and are categorised by using taxonomy terms through a select field.

Unfortunately, when editing the HTML email action element on the rule, there are a whole bunch of replacement tokens, except any related to taxonomy. I tried to "wing it" and create a taxonomy token, but of course this did not work and it seems logical that there would naturally be a disconnect here as how would the rule know to relate the correct term to the file being downloaded.

Any advice with regards to possible workarounds?

0

Make sure to add a Rules condition Entity has field (related to your field you indicated via the "through a select field..." in your question).

That's also what is mentioned in the Rules UI, e.g. when you're adding a "data comparison" condition: somewhere it says "The data selector helps you drill down into the data available to Rules. To make entity fields appear in the data selector, you may have to use the condition 'entity has field' (or 'content is of type')".

Your question seems to be related to using such field in a Rules Action (instead of a Rules Condition). However, have a look at the sample rule in included in my answer to "How to specify a Rules condition related to select list values?". That rule doesn't have a "Rules Action" that uses that field (as you seem to try to do). Though using the Rules UI to (eg) edit the message I'd want to display in my sample rule, within the list of tokes available for Replacement patterns for created content, one of them is actually [node:field-optionlist]. And the 'created content' in my case is because of the Rules Event node_insert that's used in my sample rule.

For a video tutorial that illustrates the importance of this Entity has field condition, refer to Data types and data selection, especially what is shown between about 13:30 and 17:30 in it.

PS: To have such field available to use it in any other Rules Condition also, I always add such Entity has field condition BEFORE any other Rules Conditions, if any.

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