I just downloaded this Action and gave it a try, and by dint of looking at the published code, figured out a way to do this without editing or disabling or uploading anything. To follow along, you will need a good text editor. If you’re feeling spendy, I love me some TextMate from http://Macromates.com . If you like Free, then head over to http://BareBones.com for TextWrangler.
Copy the following line of code into your text editor:
"; $r = array('mike(a)foo.org','ted(a)foo.org','sue(a)foo.org'); $recipient .= $r[$_POST['to']]; $recipient .= "
Pay careful attention to the quotes at either end, they’re the key to this working.
Inside the array $r are three e-mail addresses. (I used the (a) instead of the @ sign so that the Web forum software wouldn’t anonymize them for your safety.) Change these to the e-mail addresses you’d like to send to.
In Freeway, make your form the way you normally would, and then add a picking list called ‘to’ with the names of these addressees (or their departments) as the Choice and 0-2 as the Value (see above).
Copy the text you edited and paste it into the Email recipient field in the Actions palette.
Publish to your server. It should just work from that point on.
What we’re doing here is taking advantage of Tim’s excellent Action by writing some raw PHP into the Action interface. If you just put an e-mail address in the field where it asks for one, the Action creates this line of code:
$recipient = "you(at)there.com";
The blob of code that we add to the field modifies that code to be three lines of code in one line of text. The semicolons are the “end of line” character, so every time you see one of those, it’s as though you ended a line. And so then we build up the $recipient variable in three bites: first we set it to an empty string, then define an array, add one option from that array to $recipient, and then finally add another empty string to it (this last part is there simply to make sure you have the right number of double-quotes on the line).
In the end, the script just does what it’s told and everybody is happy.
Walter
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options