aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/AppBundle/Controller')
-rw-r--r--src/AppBundle/Controller/EmailController.php51
-rw-r--r--src/AppBundle/Controller/HomeController.php5
2 files changed, 1 insertions, 55 deletions
diff --git a/src/AppBundle/Controller/EmailController.php b/src/AppBundle/Controller/EmailController.php
deleted file mode 100644
index 982234e..0000000
--- a/src/AppBundle/Controller/EmailController.php
+++ /dev/null
@@ -1,51 +0,0 @@
-<?php
-/**
- * Created by PhpStorm.
- * User: marcin
- * Date: 11/23/17
- * Time: 10:21 AM
- */
-
-namespace AppBundle\Controller;
-
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
-use Symfony\Bundle\FrameworkBundle\Controller\Controller;
-use Swift_SmtpTransport;
-use Swift_Mailer;
-use Swift_Message;
-
-class EmailController extends Controller
-{
- /**
- * @Route("/email")
- */
- public function sendEmail()
- {
-// Create the Transport
- $transport = (new Swift_SmtpTransport('mail.cock.li', 465, 'ssl'))
- ->setUsername('***REMOVED***')
- ->setPassword('***REMOVED***')
- ;
-
-// Create the Mailer using your created Transport
- $mailer = new Swift_Mailer($transport);
-
-// Create a message
- $message = (new Swift_Message('Pollutometer warning ' . date('d/m/Y h:i:s')))
- ->setFrom(['***REMOVED***' => 'Pollutometer'])
- ->setTo(['***REMOVED***@edu.easj.dk' => 'A name'])
- ->setBody($this->renderView(
- // templates/emails/warning.html.twig
- 'warning.html.twig',
- array('name' => 'Test')
- ),
- 'text/html')
- ;
-
-// Send the message
- $result = $mailer->send($message);
-
- return $this->render('warning.html.twig', array('name' => 'Test'));
- }
-
-}
diff --git a/src/AppBundle/Controller/HomeController.php b/src/AppBundle/Controller/HomeController.php
index 70bd323..ca2043e 100644
--- a/src/AppBundle/Controller/HomeController.php
+++ b/src/AppBundle/Controller/HomeController.php
@@ -11,7 +11,6 @@ namespace AppBundle\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use AppBundle\Utils\Aqi;
-use AppBundle\Utils\EmailSender;
class HomeController extends Controller
{
@@ -20,10 +19,8 @@ class HomeController extends Controller
*/
- public function numberAction(Aqi $aqi, EmailSender $emailSender)
+ public function numberAction(Aqi $aqi)
{
- $emailSender->main();
-
$table = array(
'Co' => array('breakpoints' => [0, 4.4, 4.5, 9.4, 9.5, 12.4, 12.5, 15.4, 15.5, 30.4, 30.5, 40.4, 40.5, 50.4],
'aq' => [0, 50, 51, 100, 101, 150, 151, 200, 201, 300, 301, 400, 401, 500]),