Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.
Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
#789275
i have a problem that all the mails sent by any trigger with multi recipients, stay in pending status and not sent to the users, however the mails with single recipient is sending successfully,
here is one of the triggers:-
Code: Select all
$caseId = @@APPLICATION; //UID for current case
$users = executeQuery("SELECT DISTINCT USR_UID FROM APP_DELEGATION WHERE APP_UID = '$caseId'");
if (is_array($users) and count($users) > 0) {
   $emailTo;    //empty string to hold the emails of the participants in case
   foreach ($users as $user) {
      $aUser = userInfo($user['USR_UID']);
      $emailTo .= (empty($emailTo) ? "" : ";" ) . $aUser['mail'];
   }
   PMFSendMessage(@@APPLICATION, 'crm@imc-egypt.org', $emailTo,'' , '', 
      "Business plan rejected", 'rejected.html');
}
the mails in the mail log is in the pending status as below:
Untitledn.png
Untitledn.png (98.65 KiB) Viewed 3912 times
and as you see in the (TO) field there is no space between mail addresses (may be this is the problem so how to solve it if it is)
- i tried to run the cron file with the code
Code: Select all
"C:\Bitnami\processmaker-3.0.1.8-0\php\php.exe" -f "C:\Bitnami\processmaker-3.0.1.8-0\apps\processmaker\htdocs\workflow\engine\bin\cron.php"
put it telling me that the software is not compatible with the ( windows 8 ) however i can successfully run another php file to calculate the overdue cases with the same code
Code: Select all
"C:\Bitnami\processmaker-3.0.1.8-0\php\php.exe" -f "C:\Bitnami\processmaker-3.0.1.8-0\apps\processmaker\htdocs\workflow\engine\bin\overduecases.php"
please let me know where is the problem
#793183
Dear Amos, thank you very much for the solution. This is the exact solution to pending emails when send to more than one recipient.
In fact this mistake is done for most of the examples in Notification sections of the wiki. So it is better to review the sample codes in the wiki and change below lines:
Code: Select all
$emailTo .= (empty($emailTo) ? "" : ";" ) . $aUser['mail'];
with this one:
Code: Select all
$emailTo .= (empty($emailTo) ? "" : "," ) . $aUser['mail'];
as you mention.

Being the best in the started business is the obje[…]

Winzo is a popular and unique game on the mobile p[…]

Cannot create process using templets

Real details. The problem was solved by effect!

However, it is essential to use it responsibly and[…]