[FEATURE] Add hook to process forgot password mail
authorJigal van Hemert <jigal@xs4all.nl>
Sat, 24 Dec 2011 11:37:19 +0000 (12:37 +0100)
committerJigal van Hemert <jigal@xs4all.nl>
Fri, 24 Feb 2012 18:26:32 +0000 (19:26 +0100)
Hook to change mail content of mail which is sent
if someone forgot his password.

Change-Id: Ia154d28ba07aa112c2b1ecd39ad6281eb57ab1de
Resolves: #17055
Releases: 4.7
Reviewed-on: http://review.typo3.org/7503
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert
typo3/sysext/felogin/pi1/class.tx_felogin_pi1.php

index 8f05294..ba497fc 100644 (file)
@@ -393,6 +393,21 @@ class tx_felogin_pi1 extends tslib_pibase {
 
                $msg = sprintf($this->pi_getLL('ll_forgot_validate_reset_password', '', 0), $user['username'], $link, $validEndString);
 
+                       // Add hook for extra processing of mail message
+               if (isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['forgotPasswordMail']) &&
+                               is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['forgotPasswordMail'])
+               ) {
+                       $params = array(
+                               'message' => &$msg,
+                               'user' => &$user,
+                       );
+                       foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['forgotPasswordMail'] as $reference) {
+                               if ($reference) {
+                                       t3lib_div::callUserFunction($reference, $params, $this);
+                               }
+                       }
+               }
+
                        // no RDCT - Links for security reasons
                $oldSetting = $GLOBALS['TSFE']->config['config']['notification_email_urlmode'];
                $GLOBALS['TSFE']->config['config']['notification_email_urlmode'] = 0;