feat: re-implement contact form submissions api endpoint for website

This commit is contained in:
Björn Fromme
2026-03-16 12:00:55 +01:00
parent ab18e5f134
commit b567b6a840
11 changed files with 182 additions and 10 deletions
+19
View File
@@ -94,6 +94,25 @@ class PersonalData
];
}
public static function fromContactFormSubmission(ContactFormSubmission $dto): self
{
$gender = null !== $dto->gender ? strtoupper($dto->gender) : null;
if ('F' === $gender) {
$gender = 'W';
}
$instance = new self();
$instance->name = $dto->lastName;
$instance->firstName = $dto->firstName;
$instance->gender = $gender;
$instance->address->street = $dto->street;
$instance->address->postCode = $dto->zipCode;
$instance->address->city = $dto->city;
$instance->communication->email = $dto->email;
$instance->communication->phone = $dto->phone;
return $instance;
}
/**
* Extracts user claims for authentication and profile information.
*