diff --git a/library/NotificationCenter/ContaoHelper.php b/library/NotificationCenter/ContaoHelper.php index d93723a7..b4c4b890 100644 --- a/library/NotificationCenter/ContaoHelper.php +++ b/library/NotificationCenter/ContaoHelper.php @@ -34,6 +34,14 @@ public function sendRegistrationEmail($intId, $arrData, $objModule) return; } + if (version_compare(VERSION, '4.7', '>=')) { + /** @var \Contao\CoreBundle\OptIn\OptIn $optIn */ + $optIn = \Contao\System::getContainer()->get('contao.opt-in'); + $optInToken = $optIn->create('reg-', $arrData['email'], array('tl_member' => array($arrData['id']))); + + $arrData['activation'] = $optInToken->getIdentifier(); + } + $arrTokens = array( 'link' => \Environment::get('base') . \Environment::get('request') . (($GLOBALS['TL_CONFIG']['disableAlias'] || strpos(\Environment::get('request'), '?') !== false) ? '&' : '?') . 'token=' . $arrData['activation'] ); diff --git a/modules/ModuleNewsletterActivateNotificationCenter.php b/modules/ModuleNewsletterActivateNotificationCenter.php index 53dd7f4f..4160c715 100644 --- a/modules/ModuleNewsletterActivateNotificationCenter.php +++ b/modules/ModuleNewsletterActivateNotificationCenter.php @@ -87,6 +87,7 @@ protected function activateRecipient($token) } $strEmail = $objRecipient->email; + $objRecipient->reset(); } $time = time();