Questions and discussion about using ProcessMaker: user interface, running cases & functionality
#814940
Hi everyone,

I have a process where I create a "case impersonate" using PM APIS, I want to send a notification when case is created to the person who was assigned the case; So I'm thinking to set this as first task and send an email just after the case is created (before the owner open the case).

Is it possible?

Thanks,
Regards.
Attachments
Selection_340.png
Selection_340.png (10.2 KiB) Viewed 3367 times
#814941
Create an email template named "newCase.html".
Then, create a trigger in your process like this:
Code: Select all
$oCase = new Cases();
$aCase = $oCase->loadCase(@@APPLICATION);
$aUserInfo = userInfo($aCase['APP_CUR_USER']);
$to = $aUserInfo['mail'];
//set to email account configured in Admin > Email Servers:
$from = 'admin@example.com'; 
PMFSendMessage(@@APPLICATION, $from, $to, '', '', 'New case #'.@@APP_NUMBER,
			  'newCase.html');
Then, right click on a blank area in the process map and select "Edit Process" from the context menu. In the process properties, select the above trigger in the "Execute a trigger when a case is created" dropdown.
SetTriggerWhenCaseStarts.png
SetTriggerWhenCaseStarts.png (35.82 KiB) Viewed 3275 times
Now, an email should be sent to the first user assigned to the case.
#814957
amosbatto wrote: Wed Jun 27, 2018 9:31 pm Create an email template named "newCase.html".
Then, create a trigger in your process like this:
Code: Select all
$oCase = new Cases();
$aCase = $oCase->loadCase(@@APPLICATION);
$aUserInfo = userInfo($aCase['APP_CUR_USER']);
$to = $aUserInfo['mail'];
//set to email account configured in Admin > Email Servers:
$from = 'admin@example.com'; 
PMFSendMessage(@@APPLICATION, $from, $to, '', '', 'New case #'.@@APP_NUMBER,
			  'newCase.html');
Then, right click on a blank area in the process map and select "Edit Process" from the context menu. In the process properties, select the above trigger in the "Execute a trigger when a case is created" dropdown.
SetTriggerWhenCaseStarts.png
Now, an email should be sent to the first user assigned to the case.
Hi amosbatto,
Thanks for your time and help,

For a reason I cannot see the "Execute a trigger when a case is created"
It looks like the version of processmaker that I'm using does not have that option,

my PM version is 3.1.3.

Regards.
Attachments
Selection_346.png
Selection_346.png (54.43 KiB) Viewed 3149 times
Want to create your own meme coin?

In the world of cryptocurrencies, a unique and exc[…]

The market for cryptocurrencies is demonstrating a[…]

What's SAP FICO?

Embarking on a dissertation can be one of the most[…]

Hello. For rental housing, there are software solu[…]