feat: re-implement contact form submissions api endpoint for website
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user