]> Raphaƫl G. Git Repositories - userbundle/blobdiff - Controller/UserController.php
Translate contact name
[userbundle] / Controller / UserController.php
index 8f3e4f41ad6015b35a0b2cb784d2f37dacdaaa81..fe96dfd9eb19628b6af8a2c2a49fb0f8d25dd5b4 100644 (file)
@@ -495,7 +495,7 @@ class UserController extends AbstractController {
                                        //Create message
                                        $message = (new TemplatedEmail())
                                                //Set sender
-                                               ->from(new Address($this->config['contact']['address'], $this->config['contact']['name']))
+                                               ->from(new Address($this->config['contact']['address'], $this->translator->trans($this->config['contact']['name'])))
                                                //Set recipient
                                                //XXX: remove the debug set in vendor/symfony/mime/Address.php +46
                                                ->to(new Address($context['recipient_mail'], $context['recipient_name']))
@@ -553,7 +553,7 @@ class UserController extends AbstractController {
                        //Log new user infos
                        $this->logger->emergency(
                                $this->translator->trans(
-                                       'register: mail=%mail% locale=%locale% confirm=%confirm%',
+                                       'register: mail=%mail% locale=%locale% confirm=%confirm% ip=%ip%',
                                        [
                                                '%mail%' => $postMail = $_POST['register']['mail'],
                                                '%locale%' => $request->getLocale(),
@@ -565,7 +565,8 @@ class UserController extends AbstractController {
                                                                'hash' => $this->slugger->hash($postSmail)
                                                        ]+$this->config['route']['confirm']['context'],
                                                        UrlGeneratorInterface::ABSOLUTE_URL
-                                               )
+                                               ),
+                                               '%ip%' => $request->getClientIp()
                                        ]
                                )
                        );
@@ -687,7 +688,7 @@ class UserController extends AbstractController {
                                //Create message
                                $message = (new TemplatedEmail())
                                        //Set sender
-                                       ->from(new Address($this->config['contact']['address'], $this->config['contact']['name']))
+                                       ->from(new Address($this->config['contact']['address'], $this->translator->trans($this->config['contact']['name'])))
                                        //Set recipient
                                        //XXX: remove the debug set in vendor/symfony/mime/Address.php +46
                                        ->to(new Address($context['recipient_mail'], $context['recipient_name']))