Changeset 12037

Show
Ignore:
Timestamp:
09/06/07 12:58:32 (1 year ago)
Author:
netblade
Message:

Added an option to use user inserted email as a reply-to address

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/branch-2_6/src/no.odindata.quickform/config/config.inc

    r5970 r12037  
    1111'mail_address_from' => '', 
    1212'mail_address_to' => '', 
     13'mail_reply_to_from_submitter' => false, 
    1314'mail_reply_to' => '', 
     15'mail_reply_to_recipient' => '', 
    1416'mail_subject' => '', 
    1517'mail_encoding' => 'UTF-8', 
  • branches/branch-2_6/src/no.odindata.quickform/config/schemadb_config.inc

    r5970 r12037  
    5757            'config_domain' => 'no.odindata.quickform', 
    5858        ), 
    59  
     59        'mail_reply_to_from_submitter' => array 
     60        ( 
     61            'description' => 'set reply-to address from submitted form (schema must contain a field name email)', 
     62            'datatype' => 'boolean', 
     63            'location' => 'config', 
     64            'config_key'    => 'mail_reply_to_from_submitter', 
     65            'config_domain' => 'no.odindata.quickform', 
     66            'helptext' => 'get reply-to address from submitted form', 
     67            'hidden'   => false, 
     68            'default'  => false, 
     69        ), 
     70        'mail_reply_to' => array 
     71        ( 
     72            'description' => 'mail reply-to address', 
     73            'datatype' => 'text', 
     74            'location'    => 'config', 
     75            'config_key'  => 'mail_reply_to', 
     76            'config_domain' => 'no.odindata.quickform', 
     77        ), 
    6078        'mail_reciept_message' => array  
    6179        ( 
     
    6987            'widget_text_inputstyle' => 'longtext', 
    7088            'helptext' => 'this message is appended on top of the email sent to user', 
     89        ), 
     90        'mail_reply_to_recipient' => array 
     91        ( 
     92            'description' => 'mail reply-to address for message to the user', 
     93            'datatype' => 'text', 
     94            'location'    => 'config', 
     95            'config_key'  => 'mail_reply_to', 
     96            'config_domain' => 'no.odindata.quickform', 
    7197        ), 
    7298        'mail_reciept_data' => array 
  • branches/branch-2_6/src/no.odindata.quickform/viewer.php

    r5970 r12037  
    405405        } 
    406406         
    407         if ($this->_config->get('mail_reply_to')) 
     407        if ($this->_config->get('mail_reply_to_from_submitter') && array_key_exists('email', $fields) && $fields['email'] && array_key_exists('email', $data) && $data['email']) 
     408        { 
     409            $reply_to = $data['email']; 
     410        } 
     411        elseif ($this->_config->get('mail_reply_to')) 
    408412        { 
    409413            $reply_to = $this->_config->get('mail_reply_to'); 
     
    434438                $smessage .= $mail->body; 
    435439            } 
     440            if ($this->_config->get('mail_reply_to_recipient')) 
     441            { 
     442                $reply_to = $this->_config->get('mail_reply_to_recipient'); 
     443            } 
     444            elseif ($this->_config->get('mail_reply_to')) 
     445            { 
     446                $reply_to = $this->_config->get('mail_reply_to'); 
     447            } 
     448            else 
     449            { 
     450                $reply_to = ''; 
     451            } 
     452            $mail->headers['Reply-To'] = $reply_to; 
    436453            $mail->body = $smessage; 
    437454