• Hi,

    We use this plugin on two or three of our client sites, it works really well.

    But on one of those sites we’ve had to modify the plugin to set the From address to webmaster@client.com because if an employee of the client uses the contact form it sets the From address to “user@client.com”, and the client’s incoming email servers reject all emails from @client.com (except webmaster because that’s whitelisted) unless the email contains headers authenticating the mail as originating from client.com (to prevent spoofing).

    If it would be possible, just adding the following would really help so that we don’t have to modify the plugin every time we update to the latest version (around line 954 in si-contact-form-process.php):

    $this->si_contact_from_name  = apply_filters('si_contact_from_name', $this->si_contact_from_name);
    $this->si_contact_from_email = apply_filters('si_contact_from_email', $this->si_contact_from_email);

    Thanks,
    Tom Adams
    dxw

    http://wordpress.org/plugins/si-contact-form/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Yes in the next version

    Thread Starter mallorydxw-old

    (@tomdxw)

    Thank you very much!

    Just a note about version 4.0, it has a 2nd parameter for form number so you can control what forms you want this on.

    Add the following code to your theme’s functions.php file or to a custom plugin.
    Be sure to set the setting in the function to control which forms you want this on.
    These filters only work with versions 4.xx and up, not the 3.xx versions or lower.

    function my_action_from_name($from_name, $form_id_num) {
    
    ##################################
     // control which forms you want this on
     $all_forms = false; // set to true for process on all forms, or false to use settings below
     $forms = array('1','2');  // one or more individual forms
     ##################################
     if ( !in_array($form_id_num, $forms) && $all_forms != true)
     return $from_name;
    
      // change the email from_name
      $from_name = 'the name you want';
    
       return $from_name;
    
    }
    // filter hook to change the email from_name
    add_filter('si_contact_from_name', 'my_action_from_name', 1, 2);
    function my_action_from_email($from_email, $form_id_num) {
    
    ##################################
     // control which forms you want this on
     $all_forms = false; // set to true for process on all forms, or false to use settings below
     $forms = array('1','2');  // one or more individual forms
     ##################################
     if ( !in_array($form_id_num, $forms) && $all_forms != true)
     return $from_email;
    
      // change the email from_email
      $from_email = 'the email you want';
    
       return $from_email;
    
    }
    // filter hook to change the email from_email
    add_filter('si_contact_from_email', 'my_action_from_email', 1, 2);
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Feature request: allow using a custom from email address’ is closed to new replies.