Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#7 | pet-token-entity-types.patch | 3.81 KB | nicola85 |
#1 | pet-add-rules-state-2092195-1.patch | 977 bytes | Chim |
Comments
Comment #1
Chim CreditAttribution: Chim commentedPatch to add rules state to params so we can use rules variables in hook_pet_substitutions.
Comment #2
VladSavitsky CreditAttribution: VladSavitsky commentedHey 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.
Comment #3
Chim CreditAttribution: Chim commentedHi 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
Comment #4
VladSavitsky CreditAttribution: VladSavitsky commentedHey Chim!
Sorry for broken link. I was mentioned this patch: https://drupal.org/node/2087959
Comment #5
nicola85 CreditAttribution: nicola85 commentedComment #6
nicola85 CreditAttribution: nicola85 commentedComment #7
nicola85 CreditAttribution: nicola85 commentedComment #8
acrollet CreditAttribution: acrollet at roomify - online and open source reservation solutions commentedsee #2612754: Allow custom PETs to specify which entity tokens should be visible in replacement patterns for more info on the recent patch.