Short version:
Is there a way to assign the email address that a message goes to (in a given action) conditionally?

Long version:
I need to send an email to a specific address or role based on the acting user. So if Editor A, B, or C edited content, Publisher X should get the email; if Editor D, E, or F edited content, Publisher Y should get it. Other than the recipient, everything else in the email is the same.

The way I do it now is that there are about 10 copies of my email that are identical except for recipients. One of the conditions is "recipient has role x" (or something similar). Other than that one condition, everything else is exactly the same. Is there a way to set the "to" address programatically using a custom php condition or something?

Thanks,

Isaac

Comments

fago’s picture

hm, a way would be a new action "Set string" or so and token support for this "new" entity. then use this token for the mail address.

in rules (6.x) you could also create a rule set for the mail part and call it with one action, which gets the string passed.

isaac.niebeling’s picture

I'm using the latest version of Actions, which (I believe) uses Drupal 6-style actions, even though it's in D5. That said, I don't really know how to write an action. Could you point me in the right direction?

Thanks,

Isaac

fago’s picture

Status: Active » Fixed

workflow-ng actions are different from the actions module. If you want to write one, look at http://drupal.org/node/156754

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.