Thanks, that did the job.
For others to follow:
First I loaded the product class, then I iterated through the products in the order and loaded the category ids.
In these category ids I then searched for the desired id and if found I added a second email address.
$productClass = hikashop::get('class.product');
foreach ($data->cart->products as $product) {
$categories = $productClass->getCategories($product->product_id);
if (is_array($categories) && in_array($wantedCategoryId, $categories) {
$data->customer->user_email[] = $secondaryEmail;
break;
}
}
Kind regards, Simon