Question du test Symfony 6

Envoyer une notification avec Symfony Notifier

Intermédiaire
use Symfony\Component\Notifier\Notification\Notification;
use Symfony\Component\Notifier\NotifierInterface;
use Symfony\Component\Notifier\Recipient\Recipient;
use Symfony\Component\Routing\Annotation\Route;

class InvoiceController extends AbstractController
{
    /**
     * @Route("/invoice/create")
     */
    public function create(NotifierInterface $notifier)
    {
        $notification = (new Notification('Such an Invoice', ['email']))
            ->content('You got a new invoice.');

        $recipient = new Recipient(
            $user->getEmail(),
            $user->getPhonenumber()
        );

        ???
    }
}

Par quoi remplacer "???" et envoyer la notification ?

Auteur: JulienStatut : Publiée(Mise à jour)Question passée 373 fois
Modifier
0
Évaluations de la communautéPersonne n'a encore évalué cette question, soyez le premier !