Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • in reply to: Change the "from" email on a contact form. #251496

    Here are two functions that will pick up from email and subject from what the user entered – you can change them to suit your needs. Put them in your functions.php.

    
    // Avia Contact Form related functions
    add_filter('avf_form_from', 'avia_change_from', 10, 3);
    function avia_change_from($from, $new_post, $params){
            if (!empty($new_post['e-mail'])) {
                    $from = urldecode($new_post['e-mail']);
            }
            return $from;
    }
    
    add_filter('avf_form_subject', 'avia_change_subject', 10, 3);
    function avia_change_subject($subject, $new_post, $params){
            if (!empty($new_post['subject'])) {
                    $subject = urldecode($new_post['subject']);
            }
            return $subject;
    }
    
Viewing 1 post (of 1 total)