Ask questions about installing and configuring ProcessMaker 3
By pamiller3
#828418
I am confused, but I have setup a self-service assignment and a timeout with a trigger, but doesn't seem to be sending an email on time. Here is the layout:

I have the case automatically created at 7a.
I have the self-service timeout set to 7 hours, so that at 2p it is considered overdue.
I have the cron set to run at 4p, but no email at that time.

This is the trigger I have made:

$taskId = "9314453925f2ad79c6f2968081960850"; //change to unique ID for the task
$assignedUsers = array(); //empty array to hold the UIDs of the assigned users to the task
$userQuery = "SELECT USR_UID FROM TASK_USER WHERE TAS_UID = '$taskId' AND TU_RELATION = 1";
$groupQuery = "SELECT GU.USR_UID FROM GROUP_USER GU, TASK_USER TU WHERE
TU.TAS_UID = '$taskId' AND TU.TU_RELATION = 2 AND TU.USR_UID = GU.GRP_UID";
$users = executeQuery($userQuery);
if (is_array($users) and count($users) > 0) {
foreach ($users as $user)
$assignedUsers[] = $user['USR_UID'];
}
$users = executeQuery($groupQuery);
if (is_array($users) and count($users) > 0) {
foreach ($users as $user)
$assignedUsers[] = $user['USR_UID'];
}

$assignedUsers = array_unique($assignedUsers); //eliminate any duplicates in array
$emailTo = "";
foreach ($assignedUsers as $assignedUser) {
$aUser = userInfo($assignedUser);
$emailTo .= (empty($emailTo) ? "" : "," ) . $aUser['mail'];
}
if (!empty($emailTo)) {
PMFSendMessage(@@APPLICATION, 'processmaker@nex-tech.com', $emailTo, '', '',
"Backup Checks Not Completed", 'Unassigned-Backups.html');
}


What am I missing?
By Taniyakhan
#828426
I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well. Thanks...
http://www.divyanka.in/
By devbhanu
#828449
pamiller3 wrote:I am confused, but I have setup a self-service assignment and a timeout with a trigger, but doesn't seem to be sending an email on time. Here is the layout:

I have the case automatically created at 7a.
I have the self-service timeout set to 7 hours, so that at 2p it is considered overdue.
I have the cron set to run at 4p, but no email at that time.

This is the trigger I have made:

$taskId = "9314453925f2ad79c6f2968081960850"; //change to unique ID for the task
$assignedUsers = array(); //empty array to hold the UIDs of the assigned users to the task
$userQuery = "SELECT USR_UID FROM TASK_USER WHERE TAS_UID = '$taskId' AND TU_RELATION = 1";
$groupQuery = "SELECT GU.USR_UID FROM GROUP_USER GU, TASK_USER TU WHERE
TU.TAS_UID = '$taskId' AND TU.TU_RELATION = 2 AND TU.USR_UID = GU.GRP_UID";
$users = executeQuery($userQuery);
if (is_array($users) and count($users) > 0) {
foreach ($users as $user)
$assignedUsers[] = $user['USR_UID'];
}
$users = executeQuery($groupQuery);
if (is_array($users) and count($users) > 0) {
foreach ($users as $user)
$assignedUsers[] = $user['USR_UID'];
}

$assignedUsers = array_unique($assignedUsers); //eliminate any duplicates in array
$emailTo = "";
foreach ($assignedUsers as $assignedUser) {
$aUser = userInfo($assignedUser);
$emailTo .= (empty($emailTo) ? "" : "," ) . $aUser['mail'];
}
if (!empty($emailTo)) {
PMFSendMessage(@@APPLICATION, 'processmaker@nex-tech.com', $emailTo, '', '',
"Backup Checks Not Completed", 'Unassigned-Backups.html');
}


What am I missing?
Hello,
Any luck on this? I'm trying the same to send reminder email to group assigned to self service task when case is unassigned queue for 2 days.

You can try below code for group see if it helps. I'm trying to combine APP_CACHE_VIEW and TASK_USER for cases pending for 2 days. Let me know if you find any solution.
Thank you.

https://www.pmusers.com/index.php/Send_an_email_when_a_task_is_overdue

$emailFrom = 'processmaker.com';
$MailSubject = "Reminder: There are unassigned cases!";
$MailTemplate = 'template.html';

$taskID = "XXXXXXXXXXXXXX";
//For Group
$resultG = executeQuery("SELECT USR_UID from TASK_USER where TAS_UID='" . $taskID . "' and TU_TYPE=1 and TU_RELATION=2");

if (count($resultG) >0) {
foreach ($resultG as $rowG) {
$toG = $rowG['USR_UID'];
PMFSendMessageToGroup($toG, @@APPLICATION, $MailSender, $MailSubject, $MailTemplate, array(''), array(''), true, 0, "");
}
}
By Benther
#828482
Thanks, your advice helped me solve the problem.
This is a great forum. Thanks to the administrators.

Ben, an aditor at https://papernow.org/

A 1xbet clone script is a pre-designed software so[…]

4rabet clone script is enabling entrepreneurs to e[…]

Parimatch clone script is enabling entrepreneurs t[…]

In the world of cryptocurrency, a wallet is an app[…]