• I installed WR ContactForm on my site and created Contact US, when I clicking on the Send to email(s) under Form Action but nothing response. May i know any solution?

Viewing 2 replies - 1 through 2 (of 2 total)
  • xxfreshman

    (@xxfreshman)

    Here is the sollution, it took me and a friend more than 1 day to get it working, the problem is the preg_replace( ‘/\{\$([^\}]+)\}/ie’ command, we replaced it.

    REPLACE the following code from the file under wr-contactform1.1.10\libraries\gadget\contactform-frontend.php

    /**
    * Get Cotent Email
    *
    * @param type $emailTemplate email content
    * @param String $dataContentEmail Data content Email
    * @param Strig $nameFileByIndentifier Get name Field by Indentifier
    * @param String $requiredField required field
    * @param String $defaultSubject Default Subject Email
    *
    * @return stdClass
    */
    public function get_content_email( $emailTemplate, $dataContentEmail, $nameFileByIndentifier, $requiredField, $defaultSubject ) {
    if ( ! empty( $emailTemplate[ ‘message’ ] ) ) {
    /*$emailTemplate[ ‘message’ ] = preg_replace( ‘/\{\$([^\}]+)\}/i’, ‘@$dataContentEmail[“\\1”]’, $emailTemplate[ ‘message’ ] );*/
    $emailTemplate[ ‘message’ ] = preg_replace_callback( ‘/\{\$([^\}]+)\}/i’,function($match) use ($dataContentEmail) {return @$dataContentEmail[$match[1]];},$emailTemplate[ ‘message’ ] );

    }
    else {
    $htmlMessage = array();
    if ( $dataContentEmail ) {
    $htmlMessage = $this->email_template_default( $dataContentEmail, $nameFileByIndentifier, $requiredField );
    }
    $emailTemplate[ ‘message’ ] = $htmlMessage;
    }

    /*$emailTemplate[ ‘subject’ ] = preg_replace( ‘/\{\$([^\}]+)\}/ie’, ‘@$dataContentEmail[“\\1”]’, $emailTemplate[ ‘subject’ ] );*/
    $emailTemplate[ ‘subject’ ] = preg_replace_callback( ‘/\{\$([^\}]+)\}/i’, function($match) use ($dataContentEmail) {return @$dataContentEmail[$match[1]];}, $emailTemplate[ ‘subject’ ] );
    $emailTemplate[ ‘subject’ ] = ! empty( $emailTemplate[ ‘subject’ ] ) ? $emailTemplate[ ‘subject’ ] : $defaultSubject;
    /*$emailTemplate[ ‘from’ ] = preg_replace( ‘/\{\$([^\}]+)\}/ie’, ‘@$dataContentEmail[“\\1”]’, $emailTemplate[ ‘from’ ] );*/
    $emailTemplate[ ‘from’ ] = preg_replace_callback( ‘/\{\$([^\}]+)\}/i’, function($match) use ($dataContentEmail) {return @$dataContentEmail[$match[1]];}, $emailTemplate[ ‘from’ ] );
    /*$emailTemplate[ ‘reply’ ] = preg_replace( ‘/\{\$([^\}]+)\}/ie’, ‘@$dataContentEmail[“\\1”]’, $emailTemplate[ ‘reply’ ] );*/
    $emailTemplate[ ‘reply’ ] = preg_replace_callback( ‘/\{\$([^\}]+)\}/i’, function($match) use ($dataContentEmail) {return @$dataContentEmail[$match[1]];}, $emailTemplate[ ‘reply’ ] );
    $emailTemplate[ ‘subject’ ] = strip_tags( $emailTemplate[ ‘subject’ ] );
    $emailTemplate[ ‘from’ ] = strip_tags( $emailTemplate[ ‘from’ ] );
    $emailTemplate[ ‘reply’ ] = strip_tags( $emailTemplate[ ‘reply’ ] );

    return $emailTemplate;
    }

    /*And than it works with the ne PHP versions again :-)*/

    xxfreshman

    (@xxfreshman)

    sorry made a typing fail

    REPLACE it under wp-content/plugins/wr-contactform/libraries/gadget/contactform-frontend.php

    and its for the version 1.1.11 it maybe works for 1.1.10 too

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘click send to email(s) nothing response’ is closed to new replies.