cloudyr / limer

A LimeSurvey R Client
MIT License
67 stars 37 forks source link

Mail a specific participant with mail_registered_participants #31

Closed stephLH closed 6 years ago

stephLH commented 7 years ago

I try to mail a specific participant of a survey.

According to the API documentation, it is possible using the overrideAllConditions parameter :

/**

  • Send register mails to participants in a survey
  • Returns array of results of sending
  • Default behaviour is to send register emails to not invited, not reminded, not completed and in valid frame date participant.
  • $overrideAllConditions replaces this default conditions for selecting the participants. A typical use case is to select only one participant
  • $overrideAllConditions = Array();
  • $overrideAllConditions[] = 'tid = 2';
  • $response = $myJSONRPCClient->mail_registered_participants( $sessionKey, $survey_id, $overrideAllConditions );
  • @access public
  • @param string $sSessionKey Auth credentials
  • @param int $iSurveyID ID of the Survey that participants belong
  • @param array $overrideAllConditions replace the default conditions
  • @return array Result of the action */

I tried these three syntax with limer to mail the participant with the token id 1 :

call_limer(method = "mail_registered_participants", params = list("iSurveyID" = 123456, "overrideAllConditions" = list("tid" = "1")))
call_limer(method = "mail_registered_participants", params = list("iSurveyID" = 123456, "overrideAllConditions" = list("tid" = 1)))
call_limer(method = "mail_registered_participants", params = list("iSurveyID" = 123456, "overrideAllConditions" = "tid = 1"))

But none works :( Does anyone have an idea ?

stephLH commented 6 years ago

Here is the solution :

https://stackoverflow.com/questions/45400624/mail-a-specific-participant-with-mail-registered-participants