Questions and discussion about using ProcessMaker 2: user interface, running cases and functionality
Forum rules: Please search to see if a question has already been asked before posting. Please don't ask the same question in multiple forums.
By amform
I have a question I have been using ProcessMaker for a little more than a month, and I already know how to send an automatic email(PMFSendMessage()).However, I would like to know if it is possible to create a button that after been clicked send and email or to create a trigger where a new email can be create it (Outlook).
Thanks for the help.
By amform
Hi Ethan,
Thanks for your reply.
I created a trigger before task to retrieve the trigger ID from the PM database, but it didn't work. This is my Query:

$trigger_id = '';

$qry = 'SELECT UID FROM wf_{workflow}.TRIGGERS.TRI_UID';
$result = executeQuery($qry);
if(is_array($result) && count($result) > 0) {
foreach($result as $re) {
$trigger_id = $re['UID'];
@@Trigger_ID = $trigger_id;

If I'm not taking the right approach let me know.
Also, can you give me and example of a JS code where using the .onclick I can call the trigger to be execute?
Thanks for your help.
User avatar
By amosbatto
You can use REST to execute a trigger with JavaScript code, but it is much easier to just use a submit button to do it.

First of all, see this example to understand the concept of tying trigger code to a submit button: ... ancel_Case

You need to add an additional submit button to your DynaForm whose ID and name is "sendEmail". Add JavaScript to your DynaForm to add a value to the button when clicked:
Code: Select all
  this.value = "SEND";

Then add the following trigger which is executed after the DynaForm, which will send out the email, if the "sendEmail" button was clicked:
Code: Select all
if (@@sendEmail == "SEND") {
By amform
thanks amosbatto.
At the end this is what I did following what you gave me:
JS code:
document.getElementById("form[btn_email]").onclick = function() {
getField("send_email_2").value = "send";
PHP condition:
@@send_email_2 == "send"
and PMFSendMessage...
Doing it this way the email is sent after I submitted the task.
By petergroft
The users need to have an email app installed on their computers.
Insert a Button Element.
Create a Title for the Button. Design the SharePoint site your team deserves. ...
Fill in the Link Field. Please type in the command mailto: and the desired email of the addressee. ...
Save the page and enjoy the result!


hi i am need link download processmaker 3.7 lower[…]

It’s important that you be specific about wh[…]

is this link help?[…]

Notice: Creole.php

Hi All, I get notice when open DynaForm from Adva[…]