code: private function getMail(array $entry)
      {
          if (empty($entry['billingAddressData']['options'])) {
              return null;
          }
  
          $options = array_filter($entry['billingAddressData']['options'], function (array $option) {
              return $option['typeId'] === 5;
          });
  
          if (empty($options)) {
              return null;
          }
  
          $option = array_shift($options);
  
          return $option['value'];
      }
docs: @param array $entry
  
  @return null|string