/** * Save the form * @param $request PKPRequest */ function execute($request) { $userEmail = $this->getData('email'); $context = $request->getContext(); $notificationMailListDao = DAORegistry::getDAO('NotificationMailListDAO'); if ($password = $notificationMailListDao->subscribeGuest($userEmail, $context->getId())) { $notificationManager = new NotificationManager(); $notificationManager->sendMailingListEmail($request, $userEmail, $password, 'NOTIFICATION_MAILLIST_WELCOME'); return true; } else { $request->redirect(null, 'notification', 'mailListSubscribed', array('error')); return false; } }