2

I have always used Freeform for a single form.

For a new project, I need the user to be able to choose two different organisations in a select field. Depending on the option selected the admin email notification needs to be send to one of two email addresses.

I tried using the following code which I made following some of the example documentation on the freeform site, but I am not sure if this is what its meant for.

   {exp:freeform:form
   form_id="1"
   required="name|email|message"
   recipients="yes"
   recipient_limit="2"
   recipient_template="admin_notification"
   recipient1="Name 1|email@domain1.com"
   recipient2="Name 2||email@domain2.com""
}
    <p>
        <select name="recipient_email" />
            {freeform:recipients}
                <option value="{freeform:recipient_value}">
                    {freeform:recipient_name}
                </option>
            {/freeform:recipients}
        </select>
    </p>
    <p>Your Name: <input type="text" name="name" /></p>
    <p>Your Email: <input type="text" name="email" /></p>
    <p>Your Message: <textarea name="message"></textarea></p>
    <input type="submit" value="Submit" name="Submit" />
{/exp:freeform:form}

Can anyone tell me if this is the best route, as it doesn't appear to work as I had hoped. Do I remove the email in the control panel for admin notification? or leave an email there?

Thanks

1 Answer 1

3

Your parameters looks correct.

In the select part, it should look something like this

<select name="recipient_email">
    <option value="{freeform:recipient_value1}">Sales</option>
    <option value="{freeform:recipient_value2}">Technical Support</option>
    <option value="{freeform:recipient_value3}">Service</option>
</select>

OR

<select name="recipient_email">
    <option value="{freeform:recipient_value1}">{freeform:recipient_name1}</option>
    <option value="{freeform:recipient_value2}">{freeform:recipient_name2}</option>
    <option value="{freeform:recipient_value3}">{freeform:recipient_name3}</option>
</select>

Hope that helps. http://www.solspace.com/docs/freeform/form/#freeform_recipient_name1

2
  • 1
    Fix your recipient2 parameter, you have 2 || and double quotes at the end Apr 22, 2013 at 12:53
  • Please let me know if this helps May 3, 2013 at 9:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.