FOSUserBundle - Update email address and email canonical not working

76 Views Asked by At

After creating a user I want to make functionality to update email/ canonical email of the other accounts. I'm trying to update using:

$user = $this->fosUserManager->findUserBy(["id" => $id]);

$user->setEmail($content->email);
$this->fosUserManager->updateUser($user);

But this is not updating correctly. Is there any other way this can be done. Preferably by using the api platform itself.

Thanks and Regards :)

1

There are 1 best solutions below

0
COil On

You can use a custom data persister.