The updatePersonalData
hook is triggered after a member has updated his
personal data. It passes the front end user, the updated data and the front
end module and does not expect a return value.
Be aware that the front end user object and the database has already been updated when this hook is triggered.
\Contao\FrontendUser $member
The front end user instance who changed his data.
array $data
The submitted form data.
\Contao\Module $module
The front end module of type \Contao\ModulePersonalData
.
// src/EventListener/UpdatePersonalDataListener.php
namespace App\EventListener;
use Contao\CoreBundle\DependencyInjection\Attribute\AsHook;
use Contao\Module;
use Contao\FrontendUser;
#[AsHook('updatePersonalData')]
class UpdatePersonalDataListener
{
public function __invoke(FrontendUser $member, array $data, Module $module): void
{
// Do something …
}
}