Change email recipients based on drop-down menu choices

Insomn3ak 29 Mar, 2009
Hi,
I'm trying to dynamically change the email recipient using the drop-down menus, and I'm following this post for direction on how to accomplish that. However, I'm not receiving any emails to my test email addresses.

Here's the HTML that I'm using in my form:

<div class="form_item">
  <div class="form_element cf_dropdown" id="divsubject">
    <label class="cf_label">Subject</label><br />
    <select class="cf_inputbox" id="select_5" size="1"  name="subject">
      <option value="general">General Questions</option>
      <option value="booking">Booking</option>
      <option value="marketing">Marketing</option>
      <option value="ticketing">Ticketing</option>
    </select>
  </div>
</div>


and here's the PHP code that I'm using in the "On Submit code - before sending email" field:

<?php
    $emails_2 = array('general'=>'testemail1@gmail.com', 'booking'=>'testemail2@gmail.com', 'marketing'=>'testemail3@yahoo.com', 'ticketing'=>'testemail4@hotmail.com');
    $emails[0]->to = $emails_2[$_POST['subject']];
?>


I'm also attaching a screen shot of how I setup the email. When I used just the plain "TO" field, I received emails at my test email address, but ONLY at the one that was added in the email setup screen. The ones in the above PHP code were ignored. When I use the "Dynamic TO" field, I don't receive any emails at all.

What am I missing?
Thanks
Max_admin 29 Mar, 2009
Hi Insomn3ak,

due to some changes in the RC3 core, your code above will not work, I'm working on a new version to be out today or tomorrow which will fix this problem!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Insomn3ak 30 Mar, 2009
Ah, I see.
Thanks, looking forward to seeing the working code!
Max_admin 30 Mar, 2009
Great, check soon, it will be much better, readable and logical!😉

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.