function unsubscribeTempEmails($key, $topics_ids)
 {
     global $application;
     if (empty($topics_ids)) {
         return;
     }
     $tables = Subscriptions::getTables();
     $etable = 'subscription_email';
     $ecolumns =& $tables[$etable]['columns'];
     $ttable = 'subscription_temp';
     $tcolumns =& $tables[$ttable]['columns'];
     $dquery = new DB_Delete($etable);
     $dquery->addUsingTable($etable);
     $dquery->addUsingTable($ttable);
     $dquery->WhereValue($tcolumns['action_key'], DB_EQ, $key);
     $dquery->WhereAND();
     $dquery->Where($ecolumns['topic_id'], DB_IN, DBQuery::arrayToIn($topics_ids));
     $dquery->WhereAND();
     $dquery->WhereField($ecolumns['email_id'], DB_EQ, $tcolumns['email_id']);
     $application->db->getDB_Result($dquery);
 }