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 recipients tag vs "to" form field

February 14, 2011 7:11pm

Subscribe [2]
  • #1 / Feb 14, 2011 7:11pm

    bmagic

    1 posts

    Hey everyone,

    I am new to expression engine. I have inherited an EE project. We moved hosts and now the contact email forms are complaining about not having recipients. Now, hear me out.

    EE version 1.66 on a linux host.

    Original working Code:

    {exp:email:contact_form user_recipients="false" charset="utf-8"}
            <input type="hidden" id="subject" name="subject" size="40" value="Test Form" />
    
            <?php
            $email_0 = '[email protected]'; //test without hash
            $email_1 = base64_encode('[email protected]'); //test with hash
            
            ?>
    
            <select name="recipients" id="recipients">
                <option selected="selected">-- Select Location --</option>
                <option value="<?php echo $email_0; ?>">No Hash</option>
                <option value="<?php echo $email_1; ?>">Hash</option>
                
            </select>

    This broke when moving webservers. According to the documentation on EE, the form post variables needs to be labeled “to” and not “recipients”.

    I tried all kinds of combination’s

    - Form variable named “to” with user_recipients=“true”
    result:
    failed on base64 hash but WORKS with no hash

    - Form variable named “recipients” and user_recipients=“true”
    result:
    failed - no recipients error

    - Form variable named “recipients” and user_recipients=“false”
    result:
    failed - no recipients error

    I could never get it to send emails if the form <select> tag was named “recipients”.

    The problem is that we do not want the public to be able to read the email addresses in the <select> tag which means that we have to hash the email addresses. I couldn’t make any scenario work correctly with the hash.

    Thanks to anyone who can help!

  • #2 / Feb 15, 2011 8:43pm

    smartpill

    456 posts

    This doesn’t directly answer your question, but you can install Solspace’s Freeform and it will allow you to create the kind of form you’re trying to set up and it’s free and reasonably simple.

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

ExpressionEngine News!

#eecms, #events, #releases