Commit 46c7b24e by Julien Jorry

Delete MailController for testing email

parent bfb41bd6
<?php
namespace App\Controller;
use App\Entity\Adherent;
use App\Entity\GlobalParameter;
use App\Entity\Payment;
use App\Form\Type\AdhererFormType;
use App\Utils\CustomEntityManager;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
class MailerController extends AbstractController
{
private $em;
private $mailer;
public function __construct(CustomEntityManager $em, \Swift_Mailer $mailer)
{
$this->em = $em;
$this->mailer = $mailer;
}
/**
* @Route("/testmail",name="testmail")
*/
public function sendEmail()
{
$email = (new \Swift_Message('Message de test Kohinos'))
->setFrom($this->em->getRepository(GlobalParameter::class)->val(GlobalParameter::MLC_NOTIF_EMAIL))
->setTo('julien.jorry@gmail.com')
->setCharset('utf-8')
->setBody('Hello from symfony!');
$sentEmail = $this->mailer->send($email);
dump($sentEmail);
return $this->redirectToRoute('index');
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment