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.

Contact Form - Send to different Email addresses depending on selection

February 20, 2008 8:36am

Subscribe [3]
  • #1 / Feb 20, 2008 8:36am

    devilslayer

    27 posts

    I need to create an email form for an Association that has about 100 branches.

    I would like top implement a contact form that allows a user to select a branch from a selection of dropdown lists and to email a particular branch dependent on the selection.

    i.e

    Contact a branch

    Select your branch and complete the form below to receive information to your email address.

    Dropdown lists

    Area 1 (74 Branches)
    Area 2 (4 Branches)
    Area 3 (8 Branches)
    Area 4 (8 Branches)
    Area 5 (1 Branch)
    Area 6 (1 Branch)
    Area 7 (9 Branches)
    Area 8 (3 Branches)

    This would help cut down on the number of pages that the site needs. At present each branch has a page with its address details and contact information on it. 

    I would like to be able to use an auto responder system to send the contact information for the branch selected to the person who submitted the form.

    Is this kind of facility do-able in EE ❓

  • #2 / Feb 20, 2008 9:05am

    Simon Cox

    405 posts

    Freeform from Solspace will be adding this ability.

    In the meantime if you want to do this I suggest you use a standard Form Mail script but be careful in using these as email addresses in hidden fields get trawled by bots and some scripts are unsafe. The NMS script is the one recommended by my web host and I am using it on a EE site at the moment but will replace once Freeform is updated.

  • #3 / Feb 21, 2008 2:10am

    ruraldreams

    279 posts

    I would use a url segment to achieve this without the drop downs.

    From the branch template, link to your contact form and put the entry id for the branch in the last segment.  Then, use that number to construct a weblog:entries tag to get the email address for the branch to put into your form.  It could be a hidden field.

    So your url is
    http://www.someaddress.com/index.php/contact/23

    23 is the entry ID of the branch
    then in your contact form

    <input type="hidden" name="to" value="{exp:weblog:entries entry_id="{segment_2}"}{branch_email}{/exp:weblog:entries}">

    EDIT: Gah, I just re-read and see you want to get RID of your branch pages.  This won’t work in that case.

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

ExpressionEngine News!

#eecms, #events, #releases