Commit 95332dc3 by Denis Chenu

[doc][fix] Update README for new settings and usage

parent ab6a4114
......@@ -26,10 +26,28 @@ Allow to send token email (invite or reminder) via PHP cli . This allow to use c
- Same and more in each surveys setting
- If plugin validate the email (this allow only one email by token)
- The cron type list to be allowed in survey settings
- To test the plugin you need to call it via PHP Cli `php yourlimesurveydir/application/commands/console.php plugin cron --interval=1 sendMailCronSimulate=1`
- To test the plugin you need to call it via PHP Cli `php yourlimesurveydir/application/commands/console.php plugin cron sendMailCronSimulate=1`
- This line can be added in your crontab or Task Scheduler
- Per survey settings are found on Tools menu
### Usage of moment
In global plugin settings, admlin user can add a list of moment for sending email. This moment can be choose by survey administrator in the survey settings of the plugins.
A good solution is to use clear name for moment, for example `morning`, `weekend` with corresponding cron command. The moment are added in the command with `sendMailCronType=` : `php yourlimesurveydir/application/commands/console.php plugin cron sendMailCronType=morning`
### Usage of attribute
You can use token attribute for date/time, number and delay for sending email. Plugion global settings let admin user choose defaut attribute number, and you can update or set it in survey plugin settings.
The token is tested just before send email, then it mus be selected before by the survey settings. For each test we have:
- If the attribute didn't exist or is empty : send the email
- If the attribute is not an integer : don't send the email (warning 01 is not an integer).
- If the attribute is an integer : test is done.
Maximm email is tested including the invitation. Then if you set 1 to the attribute : only the invitation was sent. With 0 : even invitation was not sent.
For the delay : compare is done including the time, then it can take one day more if you send a lot of email.
### Params
The plugin accept optionnal parameters in the command line
......
......@@ -961,8 +961,8 @@ class sendMailCron extends \ls\pluginmanager\PluginBase
$this->sendMailCronLog("Max email by attribute {$attribute} (disabled): {$oToken->email} ({$oToken->$attribute}) for {$iSurvey}",2);
return false;
}
if($value && ctype_digit($value)) {
if($value <= $sended ) {
if(strval(intval($value))==strval($value)) {
if(intval($value) <= $sended ) {
$this->sendMailCronLog("Max email by attribute {$attribute} (done): {$oToken->email} ({$oToken->$attribute}) for {$iSurvey}",2);
return false;
}
......@@ -987,7 +987,7 @@ class sendMailCron extends \ls\pluginmanager\PluginBase
$this->sendMailCronLog("Delay after invitation by attribute {$attribute} (disabled): {$oToken->email} ({$oToken->$attribute}) for {$iSurvey}",2);
return false;
}
if($value && ctype_digit($value)) {
if(strval(intval($value))==strval($value)) {
$value=intval($value);
if($value > $dayDiff ) {
$waiting= $value - $dayDiff;
......@@ -1003,7 +1003,7 @@ class sendMailCron extends \ls\pluginmanager\PluginBase
$this->sendMailCronLog("Delay between reminders by attribute {$attribute} (disabled): {$oToken->email} ({$oToken->$attribute}) for {$iSurvey}",2);
return false;
}
if($value && ctype_digit($value)) {
if(strval(intval($value))==strval($value)) {
$value=intval($value);
if($value > $dayDiff ) {
$waiting= $value - $dayDiff;
......
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 sign in to comment