@@ -38,10 +38,10 @@ public function sendConfirmationEmailMessage(UserInterface $user)
3838 $ template = $ this ->parameters ['template ' ]['confirmation ' ];
3939 $ url = $ this ->router ->generate ('fos_user_registration_confirm ' , array ('token ' => $ user ->getConfirmationToken ()), true );
4040
41- $ context = $ this -> twig -> mergeGlobals ( array (
41+ $ context = array (
4242 'user ' => $ user ,
4343 'confirmationUrl ' => $ url
44- )) ;
44+ );
4545
4646 $ this ->sendMessage ($ template , $ context , $ this ->parameters ['from_email ' ]['confirmation ' ], $ user ->getEmail ());
4747 }
@@ -51,10 +51,10 @@ public function sendResettingEmailMessage(UserInterface $user)
5151 $ template = $ this ->parameters ['template ' ]['resetting ' ];
5252 $ url = $ this ->router ->generate ('fos_user_resetting_reset ' , array ('token ' => $ user ->getConfirmationToken ()), true );
5353
54- $ context = $ this -> twig -> mergeGlobals ( array (
54+ $ context = array (
5555 'user ' => $ user ,
5656 'confirmationUrl ' => $ url
57- )) ;
57+ );
5858
5959 $ this ->sendMessage ($ template , $ context , $ this ->parameters ['from_email ' ]['resetting ' ], $ user ->getEmail ());
6060 }
@@ -67,6 +67,7 @@ public function sendResettingEmailMessage(UserInterface $user)
6767 */
6868 protected function sendMessage ($ templateName , $ context , $ fromEmail , $ toEmail )
6969 {
70+ $ context = $ this ->twig ->mergeGlobals ($ context );
7071 $ template = $ this ->twig ->loadTemplate ($ templateName );
7172 $ subject = $ template ->renderBlock ('subject ' , $ context );
7273 $ textBody = $ template ->renderBlock ('body_text ' , $ context );
0 commit comments