ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

EE Contact Form, dropdown menu selection changes email destination

January 24, 2011 11:20am

Subscribe [1]
  • #1 / Jan 24, 2011 11:20am

    companiondesign

    14 posts

    Hey 😊 - Having some issues using the default EE form, I would like to have a drop down menu with three Venues in it, and based on what the user selects, the completed contact form will send this information to one of 3 email address’s.

    The way this is achieved doesn’t matter much, but this is what I have come up with, but it doesn’t seem to work, any suggestions? Thanks!

    The current error when i submit this form is: “Your email had no valid recipients.”

    {exp:email:contact_form user_recipients="true" charset="utf-8"} 
        
    <select name="recipients" id="recipients">
       <option value="[email protected]">Venue one</option>
       <option value="[email protected]">Venue Two</option>
    </select>
             
    <label for="from">Your Email:</label>
     
    <input type="text" id="from" name="from" size="40" maxlength="35" value="{member_email}" /></p> 
    
    <label for="subject">Subject:</label>
     
    <input type="text" id="subject" name="subject" size="40" value="Contact Form" /></p> 
        
    <label for="message">Message:</label>
     
    <textarea id="message" name="message" rows="18" cols="40">Query Email from: {member_name} Sent at: {current_time format="%Y %m %d"}</textarea></p>
    
    <input name="submit" type='submit' value='Submit Form' /></p>
    
    {/exp:email:contact_form}

    I have a feeling I may need to somehow use the “To” field and if statements to output the data in the select field to the “to” field or something?

  • #2 / Jan 24, 2011 3:39pm

    Ingmar

    29245 posts

    Yes, try using the “to” field. Just change “recipients” to “to” for testing.

  • #3 / Jan 25, 2011 3:02am

    companiondesign

    14 posts

    Thanks Ingmar, that did the trick!

  • #4 / Jan 25, 2011 5:28pm

    Ingmar

    29245 posts

    Excellent. Please post again as needed, thanks.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases