src/FlexiPeeHP/Adresar.php
public function getNotificationEmailAddress()
    {
        $email     = null;
        $emailsRaw = $this->getFlexiData($this->getApiURL(),
            ['detail' => 'custom:id,email,kontakty(primarni,email)', 'relations' => 'kontakty']);
        if (is_array($emailsRaw) && !empty($emailsRaw[0])) {
            $emails = $emailsRaw[0];
            if (array_key_exists('email', $emails) && strlen(trim($emails['email']))) {
                $email = $emails['email'];
            }
            if (array_key_exists('kontakty', $emails) && !empty($emails['kontakty'])) {
                foreach ($emails['kontakty'] as $kontakt) {
                    if (($kontakt['primarni'] == 'true') && strlen(trim($kontakt['email']))) {
                        $email = $kontakt['email'];
                        break;
                    }
                }
            }
        }
        return $email;
    }
public function getNotificationEmailAddress()
    {
        $email     = null;
        $emailsRaw = $this->getFlexiData($this->getApiURL(),
            ['detail' => 'custom:id,email,kontakty(primarni,email)', 'relations' => 'kontakty']);
        if (is_array($emailsRaw) && !empty($emailsRaw[0])) {
            $emails = $emailsRaw[0];
            if (array_key_exists('email', $emails) && strlen(trim($emails['email']))) {
                $email = $emails['email'];
            }
            if (array_key_exists('kontakty', $emails) && !empty($emails['kontakty'])) {
                foreach ($emails['kontakty'] as $kontakt) {
                    if (($kontakt['primarni'] == 'true') && strlen(trim($kontakt['email']))) {
                        $email = $kontakt['email'];
                        break;
                    }
                }
            }
        }
        return $email;
    }
public function getNotificationEmailAddress ( ) { $ email = null ; $ emailsRaw = $ this -> getFlexiData ( $ this -> getApiURL ( ) , [ 'detail' => 'custom:id,email,kontakty(primarni,email)' , 'relations' => 'kontakty' ] ) ; if ( is_array ( $ emailsRaw ) && ! empty ( $ emailsRaw [ 0 ] ) ) { $ emails = $ emailsRaw [ 0 ] ; if ( array_key_exists ( 'email' , $ emails ) && strlen ( trim ( $ emails [ 'email' ] ) ) ) { $ email = $ emails [ 'email' ] ; } if ( array_key_exists ( 'kontakty' , $ emails ) && ! empty ( $ emails [ 'kontakty' ] ) ) { foreach ( $ emails [ 'kontakty' ] as $ kontakt ) { if ( ( $ kontakt [ 'primarni' ] == 'true' ) && strlen ( trim ( $ kontakt [ 'email' ] ) ) ) { $ email = $ kontakt [ 'email' ] ; break ; } } } } return $ email ; }
get Email address for Customer with primary contact prefered

@return string email of primary contact or address email or null
get Email address for Customer with primary contact prefered