feat: assign default dummy email to participants without address

This commit is contained in:
Björn Fromme
2025-05-19 15:57:48 +02:00
parent 6bf22045c4
commit ab9d59a473
+8 -6
View File
@@ -156,13 +156,15 @@ class BookingParser extends AbstractParser
$contactNode = $node->filterXPath('//kommunikation');
if (0 < $contactNode->count()) {
$communication = new Communication();
$communication->phone = $this->getStringOrNullValue($contactNode->filterXPath('//telefonprivat'));
$communication->mobile = $this->getStringOrNullValue($contactNode->filterXPath('//telefonmobil'));
$communication->email = $this->getStringOrNullValue($contactNode->filterXPath('//email'));
$communication->newsletter = $this->getBoolValue($contactNode->filterXPath('//newsletter'));
$personalData->communication->phone = $this->getStringOrNullValue($contactNode->filterXPath('//telefonprivat'));
$personalData->communication->mobile = $this->getStringOrNullValue($contactNode->filterXPath('//telefonmobil'));
$personalData->communication->email = $this->getStringOrNullValue($contactNode->filterXPath('//email'));
$personalData->communication->newsletter = $this->getBoolValue($contactNode->filterXPath('//newsletter'));
}
$personalData->communication = $communication;
// assign default dummy address to ensure valid communication data
if (empty($personalData->communication->email)) {
$personalData->communication->email = '[email protected]';
}
return $personalData;