aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarwolaethblack <a.unal677@gmail.com>2017-11-30 12:52:21 +0100
committermarwolaethblack <a.unal677@gmail.com>2017-11-30 12:52:21 +0100
commit1e5946aba89293d1a3103adb885bff4a69c6f769 (patch)
tree18ef41b2b704aeff1127c7e36b36ab0e8928b328 /src/AppBundle
parent373010be532616b89f4c3e9fef0a972f7cf539f5 (diff)
parent1ccf8cd89e5d1d5b77a148009ad0060d8244dc8f (diff)
aaa
Diffstat (limited to 'src/AppBundle')
-rw-r--r--src/AppBundle/Controller/EmailController.php49
-rw-r--r--src/AppBundle/Controller/NewDataController.php1
2 files changed, 49 insertions, 1 deletions
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 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: andy
+ * Date: 11/23/17
+ * Time: 10:21 AM
+ */
+
+namespace AppBundle\Controller;
+
+use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
+use Symfony\Component\HttpFoundation\Response;
+use Symfony\Bundle\FrameworkBundle\Controller\Controller;
+
+class EmailController extends Controller
+{
+ /**
+ * @Route("/email")
+ */
+ public function sendEmail()
+ {
+ $message = (new \Swift_Message('Hello Email'))
+ ->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
diff --git a/src/AppBundle/Controller/NewDataController.php b/src/AppBundle/Controller/NewDataController.php
index 2e083d9..f63a7fa 100644
--- a/src/AppBundle/Controller/NewDataController.php
+++ b/src/AppBundle/Controller/NewDataController.php
@@ -12,7 +12,6 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
-
class NewDataController extends Controller
{
/**