$newSubscriptionStatus = -1; $userIsBlacklistedOrRemoved = false; if (!$emailOk) { $emailOk = 0; } else { $emailOk = 1; if ($csvImportHasPrio == false) { // 1. check if an nl user for email already exists // no -> create new one with status """confirmed""" // -> subscribe to nl list with status """approved""" // yes -> subscribe to nl list with status """approved""" $existingNewsletterUserObject = CjwNewsletterUser::fetchByEmail($email); } else { // user wurde bereits importiert? // zuerst nach remote_id suchen $existingNewsletterUserObject = CjwNewsletterUser::fetchByRemoteId($remote_id); if (is_object($existingNewsletterUserObject)) { // sicherstellen, dass wir keine duplicate emails haben if ($email != $existingNewsletterUserObject->attribute('email')) { $tmpUserObject = CjwNewsletterUser::fetchByEmail($email); if (is_object($tmpUserObject)) { // houston, we've got a problem - $tmpUserObject löschen??? // ToDo CjwNewsletterLog::writeError('CSV Import: duplicate E-Mail Adress', 'user', 'email', array('email_cur' => $existingNewsletterUserObject->attribute('email'), 'email_imp' => $email, 'remote_id' => $remoteId)); } } } // user hat sich selbst per subscription angelegt? // sonst nach email suchen if (!is_object($existingNewsletterUserObject)) { $existingNewsletterUserObject = CjwNewsletterUser::fetchByEmail($email);