Questions and discussion about using ProcessMaker: user interface, running cases & functionality
By cabrerabenj
#823547
I've seen that PMFGetNextAssignedUser() cna only be assigned to a trigger. How can I add the name of the next assigned user to the template I created?

For example, "'memberName' has submitted a form to 'managerName'."

This email will inform every participant of the case.
User avatar
By amosbatto
#823558
Let's say that your email template is named "sendToNextUser" and it has the following content:
------
Dear @#nextAssignedUserFullName,
You have been assigned to case @#APP_NUMBER.
------
Then, your trigger code would be:
Code: Select all
$taskUID = '1220028735824ce9181a724086456364'; //set to next task ID
$aAssigned = PMFGetNextAssignedUser(@@APPLICATION, $taskUID);
$fullName = $aAssigned['USR_FIRSTNAME'].' '.$aAssigned['USR_LASTNAME'];
$aVars = array('nextAssignedUserFullName' => $fullName);

$c = new Cases();
$aUsers = $c->getUsersParticipatedInCase(@@APPLICATION);
$to = $aAssigned['USR_EMAIL'];
foreach ($aUsers['array'] as $userId => $userInfo) {
   $to .= (empty($to) ? '' : ', ') . $userInfo['USR_EMAIL'];
}

PMFSendMessage(@@APPLICATION, 'boss@example.com', $aAssigned['USR_EMAIL'], '', '',
   'Upcoming case to work on', 'sendToNextUser.html', $aVars);
See:
https://wiki.processmaker.com/3.1/Proce ... User.28.29
https://wiki.processmaker.com/3.0/Inter ... Case.28.29

Remember that you should use a database query in a trigger fired after routing to look up the next assigned user if the next task does not have cyclical assignment.
By cabrerabenj
#823800
How can the current user know the name of the next assigned user in the email that is automatically sent?

For example,

Hi 'currentUser' your case has been submitted to 'nextAssignedUsername'?

Do you want a quick way to delete passwords from P[…]

Try the CloudMigration PST Converter to convert […]

In the rapidly evolving world of online sports be[…]

STEPN integrates social networking and games that […]