diff --git a/htdocs/create.php b/htdocs/create.php index 5f457e06c3dabdce8c131e497b5b570ccad3e6c7..e1fdc2b9528ed921aed6792b92dba3689cc7f845 100644 --- a/htdocs/create.php +++ b/htdocs/create.php @@ -12,6 +12,7 @@ require_once('wp_account_creator.php'); $domain = getenv("DOMAIN"); $mail_domain = getMailDomain(); +$newUserListFile = getenv('NEW_USER_LIST_FILE_PATH'); if (!isset($_POST['username']) || !isset($_POST['password']) || !isset($_POST['displayname']) || !isset($_POST['repassword'])) { $error_string = $strings["error_mandatory_missing"]; @@ -91,6 +92,7 @@ $userData->referrerCode = $referrerCode; $accountsCreators = getAccountsCreators($domain); validateAccountOnAllServices($accountsCreators, $userData); createAccounts($accountsCreators, $userData); +addUserToList($user->email); sendWelcomeMail($authmail, $mbox, $domain, $userData->name); $done = "$authmail:$authsecret:$mbox"; @@ -261,3 +263,8 @@ function sendWelcomeMailWithSendGrid(string $to, string $mbox, string $domain, s sendEmailWithSendGrid($email); } +function addUserToList(string $email) +{ + global $newUserListFile; + return file_put_contents($newUserListFile, $email.PHP_EOL , FILE_APPEND | LOCK_EX); +} \ No newline at end of file