From 8a6064b72e36e97dd17f7d5b4efb1b23c0844a86 Mon Sep 17 00:00:00 2001 From: marcinzelent Date: Thu, 30 Nov 2017 12:45:39 +0100 Subject: Added email controller. --- src/AppBundle/Controller/EmailController.php | 49 ++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 src/AppBundle/Controller/EmailController.php (limited to 'src/AppBundle/Controller/EmailController.php') diff --git a/src/AppBundle/Controller/EmailController.php b/src/AppBundle/Controller/EmailController.php new file mode 100644 index 0000000..6d78105 --- /dev/null +++ b/src/AppBundle/Controller/EmailController.php @@ -0,0 +1,49 @@ +setFrom('***REMOVED***') + ->setTo('***REMOVED***@edu.easj.dk') + ->setBody( + $this->renderView( +// app/Resources/views/Emails/registration.html.twig + 'Emails/registration.html.twig', + array('name' => "Test") + ), + 'text/html' + )/* +* If you also want to include a plaintext version of the message +->addPart( +$this->renderView( +'Emails/registration.txt.twig', +array('name' => $name) +), +'text/plain' +) +*/ + ; + +//$mailer->send($message); + +// or, you can also fetch the mailer service this way + $this->get('mailer')->send($message); + } +} \ No newline at end of file -- cgit v1.2.3