private function flattenEmailAddresses($emailAddressesByField) {
        $flattened = [];
        foreach ($emailAddressesByField as $field => $emailAddresses) {
            foreach ($emailAddresses as $emailAddress) {
                $flattened[] = $emailAddress;
            }
        }

        return array_unique($flattened);
    }