My use case required between 2 and 6 emails to be sent when a node is approved.

In rules I gather the email recipients from field collections added to rules lists and send a separate email to each.

Changing a couple of lines allows me to use the field collections to create tokens.

Patch to follow.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Chim’s picture

Assigned: Chim » Unassigned
Status: Active » Needs review
FileSize
977 bytes

Patch to add rules state to params so we can use rules variables in hook_pet_substitutions.

VladSavitsky’s picture

Hey Chim!

I have similar issue but solved it in a different way. Please take a look: https://drupal.org/node/2092195#comment-7874411.
My solution seem to be more common. But right now I think that this issue could be solved by using drupal tokens. Later I'll try to figure out how to use tokens there.

Chim’s picture

Hi Vlad,
I still had to use tokens, and a custom module to define them, but the patch above passes the rules state, and so the variables created by rules, to the params passed to hook_pet_substitutions().

Can you check your link in the previous comment, currently it points to my comment above.

thanks,
Chim

VladSavitsky’s picture

Hey Chim!

Sorry for broken link. I was mentioned this patch: https://drupal.org/node/2087959

nicola85’s picture

Issue summary: View changes
FileSize
3.87 KB
nicola85’s picture

nicola85’s picture

acrollet’s picture