$this->eventDispatcher->
dispatch( $event,
ContactFormEvent::EVENT_NAME
);
$result =
new ContactFormRouteResponseStruct();
$result->
assign([ 'individualSuccessMessage' =>
$mailConfigs['message'
] ?? '',
]);
return new ContactFormRouteResponse($result);
} private function validateContactForm(DataBag
$data, SalesChannelContext
$context): void
{ $definition =
$this->contactFormValidationFactory->
create($context);
$violations =
$this->validator->
getViolations($data->
all(),
$definition);
if ($violations->
count() > 0
) { throw new ConstraintViolationException($violations,
$data->
all());
} }