src/Shop/AdvancedConfigForm.php
protected function validateEmailAsPdfFields()
    {
        // Check for valid email address if no token syntax is used.
        $regexpEmail = '/^[^@<>,; "\']+@([^.@ ,;]+\.)+[^.@ ,;]+$/';
        if (!empty($this->submittedValues['emailTo']) && strpos($this->submittedValues['emailTo'], '[') === false && !preg_match($regexpEmail, $this->submittedValues['emailTo'])) {
            $this->errorMessages['emailTo'] = $this->t('message_validate_email_5');
        }

        // Check for valid email addresses if no token syntax is used.
        $regexpMultiEmail = '/^[^@<>,; "\']+@([^.@ ,;]+\.)+[^.@ ,;]+([,;][^@<>,; "\']+@([^.@ ,;]+\.)+[^.@ ,;]+)*$/';
        if (!empty($this->submittedValues['emailBcc']) && strpos($this->submittedValues['emailBcc'], '[') === false && !preg_match($regexpMultiEmail, $this->submittedValues['emailBcc'])) {
            $this->errorMessages['emailBcc'] = $this->t('message_validate_email_3');
        }

        // Check for valid email address if no token syntax is used.
        if (!empty($this->submittedValues['emailFrom']) && strpos($this->submittedValues['emailFrom'], '[') === false && !preg_match($regexpEmail, $this->submittedValues['emailFrom'])) {
            $this->errorMessages['emailFrom'] = $this->t('message_validate_email_4');
        }
    }
protected function validateEmailAsPdfFields()
    {
        // Check for valid email address if no token syntax is used.
        $regexpEmail = '/^[^@<>,; "\']+@([^.@ ,;]+\.)+[^.@ ,;]+$/';
        if (!empty($this->submittedValues['emailTo']) && strpos($this->submittedValues['emailTo'], '[') === false && !preg_match($regexpEmail, $this->submittedValues['emailTo'])) {
            $this->errorMessages['emailTo'] = $this->t('message_validate_email_5');
        }

        // Check for valid email addresses if no token syntax is used.
        $regexpMultiEmail = '/^[^@<>,; "\']+@([^.@ ,;]+\.)+[^.@ ,;]+([,;][^@<>,; "\']+@([^.@ ,;]+\.)+[^.@ ,;]+)*$/';
        if (!empty($this->submittedValues['emailBcc']) && strpos($this->submittedValues['emailBcc'], '[') === false && !preg_match($regexpMultiEmail, $this->submittedValues['emailBcc'])) {
            $this->errorMessages['emailBcc'] = $this->t('message_validate_email_3');
        }

        // Check for valid email address if no token syntax is used.
        if (!empty($this->submittedValues['emailFrom']) && strpos($this->submittedValues['emailFrom'], '[') === false && !preg_match($regexpEmail, $this->submittedValues['emailFrom'])) {
            $this->errorMessages['emailFrom'] = $this->t('message_validate_email_4');
        }
    }
protected function validateEmailAsPdfFields ( ) { // Check for valid email address if no token syntax is used. $ regexpEmail = '/^[^@<>,; "\']+@([^.@ ,;]+\.)+[^.@ ,;]+$/' ; if ( ! empty ( $ this -> submittedValues [ 'emailTo' ] ) && strpos ( $ this -> submittedValues [ 'emailTo' ] , '[' ) === false && ! preg_match ( $ regexpEmail , $ this -> submittedValues [ 'emailTo' ] ) ) { $ this -> errorMessages [ 'emailTo' ] = $ this -> t ( 'message_validate_email_5' ) ; } // Check for valid email addresses if no token syntax is used. $ regexpMultiEmail = '/^[^@<>,; "\']+@([^.@ ,;]+\.)+[^.@ ,;]+([,;][^@<>,; "\']+@([^.@ ,;]+\.)+[^.@ ,;]+)*$/' ; if ( ! empty ( $ this -> submittedValues [ 'emailBcc' ] ) && strpos ( $ this -> submittedValues [ 'emailBcc' ] , '[' ) === false && ! preg_match ( $ regexpMultiEmail , $ this -> submittedValues [ 'emailBcc' ] ) ) { $ this -> errorMessages [ 'emailBcc' ] = $ this -> t ( 'message_validate_email_3' ) ; } // Check for valid email address if no token syntax is used. if ( ! empty ( $ this -> submittedValues [ 'emailFrom' ] ) && strpos ( $ this -> submittedValues [ 'emailFrom' ] , '[' ) === false && ! preg_match ( $ regexpEmail , $ this -> submittedValues [ 'emailFrom' ] ) ) { $ this -> errorMessages [ 'emailFrom' ] = $ this -> t ( 'message_validate_email_4' ) ; } }
Validates fields in the "Email as pdf" settings fieldset.
Validates fields in the Email as pdf settings fieldset .