Opt out of web when opting out of CATI

This commit is contained in:
Adam Zammit committed 2017-05-11 12:20:48 +10:00
1 parent 4b5044d59a
commit bfc6af3d7c
2 files changed
+47 -1

No files matched your search

+31
View File
@@ -185,6 +185,37 @@ function lime_send_email($case_id,$email,$firstname,$lastname)
return $ret;
}
function lime_set_token_properties($case_id,$params = array('emailstatus' => 'OptOut'))
{
global $db;
global $limeRPC;
global $limeKey;
$sql = "SELECT c.token,c.questionnaire_id
FROM `case` as c
WHERE c.case_id = '$case_id'";
$rs = $db->GetRow($sql);
$token = $rs['token'];
$qid = $rs['questionnaire_id'];
$lime_id = limerpc_init_qid($qid);
$ret = false;
if ($lime_id !== false) {
$q = $limeRPC->set_participant_properties($limeKey,$lime_id,array('token' => $token),$params);
if (!isset($q['status'])) {
$ret = true;
}
}
limerpc_close();
return $ret;
}
/** Get completed responses as an array based on the case_id
*/