FOSUserBundle – Update email address and email canonical not working

  api, api-platform.com, fosuserbundle, php, symfony4

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 🙂

Source: Symfony4 Questions

LEAVE A COMMENT