public static function writeToLog($email, $result = false, $error_msg = false) { $username = ''; $admin = ''; if (SJB_Settings::getSettingByName('notification_email') != $email->recipient_email) { $username = SJB_UserManager::getUserSIDbyEmail($email->recipient_email); } if (!$username) { $admin = SJB_SubAdminManager::getUserSIDbyEmail($email->recipient_email); $admin = $admin ? $admin : 'admin'; } $status = 'Delivered'; if (!$result) { $status = 'Undelivered'; } elseif ('Not Sent' === $result) { $status = $result; } SJB_DB::query("INSERT INTO `email_log` (`date`, `subject`, `email`, `message`, `username`, `admin`, `status`, `error_msg`) VALUES (NOW(), ?s, ?s, ?s, ?s, ?s, ?s, ?s)", $email->subject, $email->recipient_email, $email->text, $username, $admin, $status, $error_msg); }
public function execute() { $template_processor = SJB_System::getTemplateProcessor(); $ERRORS = array(); $message_was_sent = false; if (!empty($_REQUEST['email'])) { $user_sid = SJB_UserManager::getUserSIDbyEmail($_REQUEST['email']); if (!empty($user_sid)) { $message_was_sent = SJB_Notifications::sendUserPasswordChangeLetter($user_sid); } else { $ERRORS['WRONG_EMAIL'] = 1; } } if (!$message_was_sent) { $email = SJB_Request::getVar('email', ''); $template_processor->assign('errors', $ERRORS); $template_processor->assign('email', $email); $template_processor->display('password_recovery.tpl'); } else { $template_processor->display('password_change_email_successfully_sent.tpl'); } }
public function defineWetherEmailIsNeeded() { if (!empty(self::$oProfile->email) && !strstr(self::$oProfile->email, 'proxymail.facebook.com') && !SJB_UserManager::getUserSIDbyEmail(self::$oProfile->email)) { $key = array_search('email', self::$aUserFields); if ($key !== false) { unset(self::$aUserFields[$key]); } } }