Yes,
you got the sample.
The only remaining thing is to parse the csv file and to determine which survey.
1. parsing
Code:
...
$csvArray = array_map('str_getcsv', file('participants.csv'));
$length = count($csvArray);
for ($i=1; $i<$length; $i++)
{
$firstName = $csvArray[$i][0];
$lastName = $csvArray[$i][1];
$email = $csvArray[$i][2];
$language = 'en';
// the survey to process
$iSurveyID=$csvArray[$i][3];
$atokenParams = array("email"=>$email,"lastname"=>$lastName,"firstname"=>$firstName,"language"=>$language,"emailstatus"=>"OK");
$aParticipantData=array($atokenParams);
$bCreateToken = true;
....
With this csv file
Code:
firstname,lastname,email,surveyID
Adalbert,Ameise,mail1@example.org,434736
Berta,Biber,mail2@example.org,287114
Carlo,Chinchilla,mail3@example.org,288954
Doris,Dachs,mail4@example.org,434736
Emil,Eidechse,mail5@example.org,288954
2. which survey to select
You see in the csv file I entered the resp. surveyID.
You also can set only a special sign for the type of incident and select the survey with an IF
And you want to run this from "localhost"? Do these participants have access to your local computer?
Joffm