Commit a45b01af authored by Raph El's avatar Raph El
Browse files

Batch referenceMail

parent 3edf01e2
......@@ -5478,6 +5478,30 @@ if( Role::isSuperAdmin(Role::getRolesUserId(Yii::app()->session["userId"]) )){
echo "Number of user with preferences modified : ".$nbUser;
}
}
public function actionReferenceFail() {
if( Role::isSuperAdmin(Role::getRolesUserId(Yii::app()->session["userId"]) )){
$nbUser = 0;
$mails = PHDB::find( Cron::COLLECTION,
array( "status" => "fail",
"tpl" => "referenceEmailInElement") );
//Rest::json($mails); exit;
foreach ($mails as $keyE => $elt) {
$res = PHDB::update(Cron::COLLECTION,
array("_id"=>new MongoId($keyE)),
array('$set' => array( "status" => "pending" ) ) );
if($res["ok"] == 1){
$nbUser++;
}else{
echo "<br/> Error with user id : ".$key;
}
}
//Rest::json($tags); exit;
echo "Number of mails with status modified : ".$nbUser;
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment