// Check the status of the registration process
switch ($STATUS) {
case 'added': // Sponsor successfully added with account status = UNCONFIRMED!
// Check the status of the registration process
switch ($STATUS) {
case 'added': // Sponsor successfully added with account status = UNCONFIRMED!
$result = SQL_QUERY_ESC("SELECT `id`, `hash` FROM `{?_MYSQL_PREFIX?}_sponsor_data` WHERE `email`='%s' LIMIT 1",
array(postRequestElement('email')), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
$result = SQL_QUERY_ESC("SELECT `id`, `hash` FROM `{?_MYSQL_PREFIX?}_sponsor_data` WHERE `email`='%s' LIMIT 1",
array(postRequestElement('email')), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
list($id, $hash) = SQL_FETCHROW($result);
// Prepare data for the email template
list($id, $hash) = SQL_FETCHROW($result);
// Prepare data for the email template
$content['surname'] = secureString(postRequestElement('surname'));
$content['family'] = secureString(postRequestElement('family'));
$content['gender'] = translateGender(postRequestElement('gender'));
$content['surname'] = secureString(postRequestElement('surname'));
$content['family'] = secureString(postRequestElement('family'));
$content['gender'] = translateGender(postRequestElement('gender'));
$content['password'] = secureString(postRequestElement('pass1'));
// Generate email and send it to the new sponsor
$content['password'] = secureString(postRequestElement('pass1'));
// Generate email and send it to the new sponsor