diff --git a/core/lib/Thelia/Config/Resources/routing/front.xml b/core/lib/Thelia/Config/Resources/routing/front.xml
index 351ba2ab4..542a1a319 100755
--- a/core/lib/Thelia/Config/Resources/routing/front.xml
+++ b/core/lib/Thelia/Config/Resources/routing/front.xml
@@ -164,4 +164,8 @@
+
+ Thelia\Controller\Front\Mail::test
+
+
diff --git a/core/lib/Thelia/Controller/BaseController.php b/core/lib/Thelia/Controller/BaseController.php
index e9f359411..548ef9681 100755
--- a/core/lib/Thelia/Controller/BaseController.php
+++ b/core/lib/Thelia/Controller/BaseController.php
@@ -303,4 +303,17 @@ class BaseController extends ContainerAware
return $mailer->getSwiftMailer();
}
+
+ /**
+ * @return ParserInterface instance parser
+ */
+ protected function getParser()
+ {
+ return $this->container->get("thelia.parser");
+ }
+
+ protected function render($inline)
+ {
+ return $this->getParser()->fetch(sprintf("string:%s", $inline));
+ }
}
diff --git a/core/lib/Thelia/Controller/Front/Mail.php b/core/lib/Thelia/Controller/Front/Mail.php
new file mode 100644
index 000000000..dfaf2d4fa
--- /dev/null
+++ b/core/lib/Thelia/Controller/Front/Mail.php
@@ -0,0 +1,49 @@
+. */
+/* */
+/*************************************************************************************/
+
+namespace Thelia\Controller\Front;
+
+
+/**
+ * Class Mail
+ * @package Thelia\Controller\Front
+ * @author Manuel Raynaud
+ */
+class Mail extends BaseFrontController
+{
+ /**
+ * This is a demo how to send a mail using swiftmailer + smarty
+ */
+ public function test()
+ {
+ $message = \Swift_Message::newInstance('Wonderful Subject')
+ ->setFrom(array('john@doe.com' => 'John Doe'))
+ ->setTo(array('mraynaud@openstudio.fr' => 'name'))
+ ->setBody($this->render('Here is the message itself'))
+ ;
+
+ $this->getMailer()->send($message);
+
+ exit;
+ }
+}
\ No newline at end of file