src/Factory/Email.php
protected function addRecipient($mUserIdOrEmail, $bAppend, &$aArray)
    {
        if (!$bAppend) {
            $aArray = [];
        }

        if (strpos($mUserIdOrEmail, ',') !== false) {
            $mUserIdOrEmail = array_map('trim', explode(',', $mUserIdOrEmail));
        }

        if (is_array($mUserIdOrEmail)) {
            foreach ($mUserIdOrEmail as $sUserIdOrEmail) {
                $this->addRecipient($sUserIdOrEmail, true, $aArray);
            }
        } else {
            $this->validateEmail($mUserIdOrEmail);
            $aArray[] = $mUserIdOrEmail;
        }

        return $this;
    }
protected function addRecipient($mUserIdOrEmail, $bAppend, &$aArray)
    {
        if (!$bAppend) {
            $aArray = [];
        }

        if (strpos($mUserIdOrEmail, ',') !== false) {
            $mUserIdOrEmail = array_map('trim', explode(',', $mUserIdOrEmail));
        }

        if (is_array($mUserIdOrEmail)) {
            foreach ($mUserIdOrEmail as $sUserIdOrEmail) {
                $this->addRecipient($sUserIdOrEmail, true, $aArray);
            }
        } else {
            $this->validateEmail($mUserIdOrEmail);
            $aArray[] = $mUserIdOrEmail;
        }

        return $this;
    }
protected function addRecipient ( $ mUserIdOrEmail , $ bAppend , & $ aArray ) { if ( ! $ bAppend ) { $ aArray = [ ] ; } if ( strpos ( $ mUserIdOrEmail , ',' ) !== false ) { $ mUserIdOrEmail = array_map ( 'trim' , explode ( ',' , $ mUserIdOrEmail ) ) ; } if ( is_array ( $ mUserIdOrEmail ) ) { foreach ( $ mUserIdOrEmail as $ sUserIdOrEmail ) { $ this -> addRecipient ( $ sUserIdOrEmail , true , $ aArray ) ; } } else { $ this -> validateEmail ( $ mUserIdOrEmail ) ; $ aArray [ ] = $ mUserIdOrEmail ; } return $ this ; }
Adds a recipient

@param integer|string $mUserIdOrEmail The user ID to send to, or an email address
@param bool           $bAppend        Whether to add to the list of recipients or not
@param array          $aArray         The array to add the recipient to

@return $this
Adds a recipient