Hello,

 

I have a business process that at some point sends an automated email. Till some updates ago, I've seen that those emails generate activities with type = Email and I could display those emails in a detail or do some statistics based on those activities. 

But now those activities are no longer generated. Are those emails stored somewhere else? Or do I need to setup something extra at that "Send email" task in order to generate that activity.

 

Thank you,

Cristian Galatan.

Like 0

Like

2 comments

Hello Cristian,

When sending email automatically no activity record is created in the system, therefore this email can't be linked to a case as it is not in the system. That is why it doesn't allow you to bind any record to Send email element in advanced settings. As a workaround you can whether use manual send or send email from a script task. Here is and example:

https://community.bpmonline.com/questions/email-attachments-business-pr…

Best regards,

Oscar

Oscar Dylan,

Thank you Oscar.

I wanted to confirm that was the issue. I'll do a workaround.

Thanks again,

Cristian Galatan.

Show all comments

There is a difference between incoming and outgoing emails in the Communication Panel

But my question is if there is a parameter which separates these E-mails on the Activity object?

I can't seem to find a parameter for this.

Calls has the Direction parameter.

Activities lack this parameter

Should there be one?

 

2 comments

Dear Julius,

This option is available. If you are talking about business process, you should use Message type lookup to select the required parameter http://prntscr.com/pbnhhm This column can also be found in the activity object http://prntscr.com/pbni9r 

Note, if you try to build the filter in the section based on this column - you will not see any activities with the Email type due to the application logic. http://prntscr.com/pbnio9

Best regards,

Dean

Dean Parrett,

There it is! Thank you so much!

Show all comments

Is there a way to read all the users inside an organizational role and then send those email addresses to the next step of a process?

Like 0

Like

2 comments

The functionality can be implemented using a script task element in order to select all contact emails which are included in the role. The contact emails are selected from the database via EntitySchemaQuery. Then join all selected emails into a string using ";" as separator. After that use the newly built string of emails as an email for sending.

The basic business process "Send email to case group" works in the same way. Please feel free to use the business process as an example. Pay attention to the script task element "Prepare Recipient Emails" (https://prnt.sc/p0tv3t).

Show all comments

How can I send an email from a business process to a group of recipients who are in the same Organizational Unit?

For example, highlighted in the picture below I tried to make a process that sent an email to the contacts in the organizational role "Strategic Partner Support", however when the process ran, no email was sent. So instead I had to add individual contacts, but I am trying to avoid needing to update individual contacts in this process element as our employees come and go or change roles.

I also tried using a system setting, and added a organizational role to that system setting, but that did not send an email either. Can anyone advise on the best way to do this?

 

Like 0

Like

2 comments

Unfortunately, there is no opportunity to send an email to the organizational role via a business process element "Send email".

However the functionality can be implemented. An idea is to use a script task element in order to select all contact emails which are included in the role. They are selected from the database via EntitySchemaQuery. Then join all selected emails into a string using ";" as separator. After that use the newly built string of emails as an email for sending.

The basic business process "Send email to case group" works in the same way. Please feel free to use the business process as an example. I recommend you to copy the process, change conditions for launching according to your purpose and change an email template. Pay attention to the script task element "Prepare Recipient Emails".

 

Show all comments

Hi,

I created a email template with a custom subject ([#Account#] - [#imdPedRamoSeguro#] - [#Number#]) but when the email is sent the subject allways changes to "RE: + Case Number".

How can I change this default value?

Thanks.

Best Regards,

Nuno Gonçalves

Like 0

Like

1 comments

Hello,

The subject line is formed with the help of hard-coded macros that belong to the base system schema EmailMessagePublisherPage. Regardless of the displayed template subject, the base logic works and the macros is populated using the case subject value http://prntscr.com/o6issp. If you want to change this logic you need to replace EmailMessagePublisherPage page and after that develop new logic, but unfortunately we don't have a practical code to share.

Our developers will add the option to change the subject in one of the further system versions, indeed, though there is no ETA for it yet. At the moment to change the subject you can change the case subject itself on the case page.

Best regards,

Oscar

Show all comments

Hi all,

    How can I use business process to check an email existed or not, and add new email for a contact if not existed?

Thanks

Like 0

Like

2 comments

Hello, 

All contact emails are stored in the object Contact communication object, so in order to check if such record exists you need to count records with the email (http://prntscr.com/nu09fv). If the calculated number is 0 you can add email to Contact using Add data element adding the Contact communication option (http://prntscr.com/nu0btq)

Best regards,

Dennis

Dennis Hudson,

Thank you Dennis, it works well

Show all comments

Hello, has anyone else found an issue with email sync where ALL emails will get posted to your company's Account record on the history tab? Since all internal employees are part of our company's account, this means if our employees sync our O365 email accounts with bpm'online, then ALL emails are visible to ALL employees. This could be problematic if a manager is using email to discuss one of their employees compensation or performance.

Does anyone have any suggestions how to avoid this issue?

We like email sync for the visibility and history of communication between our company employees and our clients. However the caveat of intra-company emails being seen by all is not ideal.

Like 0

Like

8 comments

Dear Mitch,

There is no such out-of-the-box functionality that wold record the emails on the Our Company account. It seems like you have some custom Email detail that is based on Contact object. The default settings are as follows http://prntscr.com/nfuwza

Most likely the current one is based on contact object. Please make sure you have the correct detail. 

Best regards,

Dean

Dean Parrett,

We are using the out of the box email detail, the same as what you show in your screenshot. Since I am a contact in our instance, and my company is my account connected to my contact record, any email that syncs from my O365 outlook account to bpm is shown in the email detail on the account page history tab. Access for all of our users is open for accounts and contacts, this means every user can see every email for everyone. For this reason we have stopped using email sync and have instead started using the SmartCloud Connect Marketplace Add-in for Outlook.

Dear Mitch,

We've tried to recreate the same behavior but no emails getting posted in the account history. In this respect, I'd like to suggest you to approach our support team via support@bpmonline.com and investigate the issue in your particular environment.

Best regards,

Dean

Dean Parrett,

I can do that, but isn't this very basic functionality of bpm? If a email enters bpm'online via email sync, and sender's email belongs to a contact in the system, the email gets recorded as an email type activity and that activity record automatically inherits the connections of the contact and account.

We rely on this functionality for case creation, if a contact sends an email to create a case, the case gets created and the contact and account columns get filled in automatically. The problem is this also leads to our own internal emails all getting recorded if we use email sync for our own internal email accounts.

Dear Mitch,

Yes, linking the emails is a basic functionality but the problem here might be in the access rights. Therefore, it is better to approach our support team to have a closer look into the permissions settings to make sure you are provided with the correct solution. Also there might be a change that indeed it is some bug and we would need to investigate it.

Best regards,

Dean

Mitch Kaschub,

Hey Mitch - wondering what was the outcome of this? We are seeing similar issues on our side. 

Hi Alex, here is the resolution provided to me from my support case I had opened:

"Dear Mitch,



There is a feature called MailboxRightsForEmail. This feature divides emails and activities and grant different rights for them. This feature is currently disabled so all emails have the same access rights as activities - thus all users can see all emails. We can enable it on your instance but it will lead to mass data loss if the access rights are not set up. By saying that I mean that if there are users who must see certain emails they will not see it anymore if mailbox is not shared. So before we enable that feature please go through all mailboxes that exist in the system and make sure that all users have proper access rights for them."

 

I intend to explore this feature in a test environment to see how to use it and how well it works. In the interim, our solution is to use the outlook Add-in called "Smartcloud Connect for bpmonline" where users can push one specific targeted email to bpm from their outlook mailbox.

Alex Zarate,

see response above.

Show all comments

Customization of the unsupscribe function is represented in the following php codes:

Functions:

<?php
function BPMAuth(){
    $url = 'https://bpmonline.com/ServiceModel/AuthService.svc/Login';//someBPMURL
    $requestData["UserName"] = "";
    $requestData["UserPassword"] = "";    
    $jcres = json_encode($requestData);    
    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_COOKIEJAR,'cookie.txt');
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
    curl_setopt($ch, CURLOPT_POSTFIELDS, $jcres);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
    'Content-Length: ' . strlen($jcres))
    );
    $result = curl_exec($ch);
    curl_close($ch);
}
function BPMQuery($json,$operation) {
    //Operations: 1-Add Data; 2 - Update Data; 3 - batch Data; 4 - SelectQuery
    switch ($operation) {
    case 1:
        $queryOperation='InsertQuery';
        break;
    case 2:
        $queryOperation='UpdateQuery';
        break;
    case 3:
        $queryOperation='BatchQuery';
        break;
    case 4:
        $queryOperation='SelectQuery';
        break;
}
    $url = 'https://bpmonline.com/0/DataService/json/SyncReply/'.$queryOperation;
    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt');
    curl_setopt($ch, CURLOPT_COOKIEJAR,'cookie.txt');
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT ,0); 
    curl_setopt($ch, CURLOPT_TIMEOUT, 10);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
    'Content-Length: ' . strlen($json))
    );
    return curl_exec($ch);
    curl_close($ch);
} // Sends Update Query to BPM
function BuildIdFilter(array $array){
    $i=0;
    $filter='';
    foreach ($array as $item)
        {
            if ($i!=0) $filter.=',';
            $filter.='
            "CustomFilters'.$i.'":{
            "filterType":1,
            "comparisonType":3,
            "isEnabled":true,
            "trimDateTimeParameterToDate":false,
            "leftExpression":{
    		   "expressionType":0,
    		   "columnPath":"Id"
    			},
            "rightExpression":{
               "expressionType":2,
               "parameter":{
                  "dataValueType":0,
                  "value":"'.$item.'"
               }
            }
         }';
        $i++;  
 
        }
    return $filter;
} // Build Json Array Filter
function BuildSubscribeJson($filter,$bool){
    //$filter is filter to be applied in Json
    //$bool - to set true (Subscribed) or false(unsubscribed) for subscription
    if($bool==true) {$subsvalue='1a5cd9b8-b999-4b65-b8a8-bd3168792128';}
    else {$subsvalue='c8947f80-a374-412a-bbc8-ea9068a8b78e';}
    return '{
                           "rootSchemaName":"BulkEmailSubscription",
                           "operationType":2,
                           "filters":{
                              "items":{
                                 '.$filter.'
                              },
                              "logicalOperation":1,
                              "isEnabled":true,
                              "filterType":6
                           },
                           "columnValues":{
                              "items":{
                                 "BulkEmailSubsStatus":{
                                    "expressionType":2,
                                    "parameter":{
                                       "dataValueType":10,
                                       "value":"'.$subsvalue.'"
                                    }
                                 }
                              }
                           },
                           "isForceUpdate":false
                        }';
 
}
function JsonAddNewSubscriber($contactId,array $bulkemailtype,$bool_subsctiption){
    //$contactId Id of contuct to be subscribed
    //$bulkemailtype is id of bulk email to be subscribed
    //$bool_subsctiption - to set true (Subscribed) or false(unsubscribed) for subscription
    if($bool_subsctiption==true) {$subsvalue='1a5cd9b8-b999-4b65-b8a8-bd3168792128';}
    else {$subsvalue='c8947f80-a374-412a-bbc8-ea9068a8b78e';}
    $i=0;
    $insertItems='';
 
 
    foreach ($bulkemailtype as $value) {
        if ($i!=0) $insertItems.=',';
        $insertItems.='{
            "__type": "Terrasoft.Nui.ServiceModel.DataContract.InsertQuery",
 
           "rootSchemaName":"BulkEmailSubscription",
           "operationType":1,
           "columnValues":{
              "items":{
                 "Contact":{
                    "expressionType":2,
                    "parameter":{
                       "dataValueType":10,
                       "value":"'.$contactId.'"
                    }
                 },
                 "BulkEmailType":{
                    "expressionType":2,
                    "parameter":{
                       "dataValueType":10,
                       "value":"'.$value.'"
                    }
                 },
                 "BulkEmailSubsStatus":{
                    "expressionType":2,
                    "parameter":{
                       "dataValueType":10,
                       "value":"'.$subsvalue.'"
                    }
                 }
              }
           }
 
        }';
        $i++;
    }
    return '{"items": ['.$insertItems.']}';
}
function ContactUnsubscribe($contactId,$bool){
    return '{
  "rootSchemaName": "Contact",
  "operationType": 2,
  "filters": {
    "items": {
      "primaryColumnFilter": {
        "filterType": 1,
        "comparisonType": 3,
        "isEnabled": true,
        "trimDateTimeParameterToDate": false,
        "leftExpression": {
          "expressionType": 1,
          "functionType": 1,
          "macrosType": 34
        },
        "rightExpression": {
          "expressionType": 2,
          "parameter": {
            "dataValueType": 0,
            "value": "'.$contactId.'"
          }
        }
      }
    },
    "logicalOperation": 0,
    "isEnabled": true,
    "filterType": 6
  },
  "columnValues": {
    "items": {
      "DoNotUseEmail": {
        "expressionType": 2,
        "parameter": {
          "dataValueType": 12,
          "value": '.$bool.'
        }
      }
    }
  },
  "isForceUpdate": false
}'; // Json Request
}
function JsonSelectSubscriptions($contactId){
    $json= '{
       "rootSchemaName":"BulkEmailSubscription",
       "operationType":0,
       "filters":{
          "items":{
             "customFilterContact_BulkEmailSubscription":{
                "filterType":1,
                "comparisonType":3,
                "isEnabled":true,
                "trimDateTimeParameterToDate":false,
                "leftExpression":{
                   "expressionType":0,
                   "columnPath":"Contact"
                },
                "rightExpression":{
                   "expressionType":2,
                   "parameter":{
                      "dataValueType":10,
                      "value":"'.$contactId.'"
                   }
                }
             }
          },
          "logicalOperation":0,
          "isEnabled":true,
          "filterType":6
       },
       "columns":{
          "items":{
             "Id":{
                "caption":"",
                "orderDirection":0,
                "orderPosition":-1,
                "isVisible":true,
                "expression":{
                   "expressionType":0,
                   "columnPath":"Id"
                }
             },
             "BulkEmailType":{
                "caption":"Bulk email type",
                "orderDirection":0,
                "orderPosition":-1,
                "isVisible":true,
                "expression":{
                   "expressionType":0,
                   "columnPath":"BulkEmailType"
                }
             },
             "BulkEmailSubsStatus":{
                "caption":"Subscription status",
                "orderDirection":0,
                "orderPosition":-1,
                "isVisible":true,
                "expression":{
                   "expressionType":0,
                   "columnPath":"BulkEmailSubsStatus"
                }
             }
          }
       },
       "isDistinct":false,
       "rowCount":30,
       "rowsOffset":0,
       "isPageable":false,
       "allColumns":false,
       "useLocalization":true,
       "useRecordDeactivation":false,
       "serverESQCacheParameters":{
          "cacheLevel":0,
          "cacheGroup":"",
          "cacheItemName":""
       },
       "queryOptimize":false,
       "useMetrics":false,
       "querySource":0,
       "ignoreDisplayValues":false,
       "conditionalValues":null,
       "isHierarchical":false
    }'; // Json Request
    return $json;
}
function JsonSelectdefaultchannels(){
    $json= '{"rootSchemaName":"BulkEmailType","operationType":0,"filters":{"items":{"64ae0f22-cb41-4599-97c1-3571c0fe56f3":{"items":{},"logicalOperation":0,"isEnabled":true,"filterType":6}},"logicalOperation":0,"isEnabled":true,"filterType":6},"columns":{"items":{"Id":{"caption":"","orderDirection":0,"orderPosition":-1,"isVisible":true,"expression":{"expressionType":0,"columnPath":"Id"}},"Name":{"caption":"","orderDirection":0,"orderPosition":-1,"isVisible":true,"expression":{"expressionType":0,"columnPath":"Name"}},"Description":{"caption":"Description","orderDirection":0,"orderPosition":-1,"isVisible":true,"expression":{"expressionType":0,"columnPath":"Description"}},"IsSignable":{"caption":"Can be subscriber","orderDirection":0,"orderPosition":-1,"isVisible":true,"expression":{"expressionType":0,"columnPath":"IsSignable"}},"EntryPointsCount":{"caption":"","orderDirection":0,"orderPosition":-1,"isVisible":true,"expression":{"expressionType":3,"aggregationType":1,"columnPath":"[EntryPoint:EntityId].Id","subFilters":{"items":{"c0c2fa11-5faa-415d-98d6-83df4bb90770":{"filterType":1,"comparisonType":3,"isEnabled":true,"trimDateTimeParameterToDate":false,"leftExpression":{"expressionType":0,"columnPath":"IsActive"},"rightExpression":{"expressionType":2,"parameter":{"dataValueType":1,"value":true}}}},"logicalOperation":0,"isEnabled":true,"filterType":6}}},"CreatedOn":{"caption":"","orderDirection":0,"orderPosition":-1,"isVisible":true,"expression":{"expressionType":0,"columnPath":"CreatedOn"}},"CreatedBy":{"caption":"","orderDirection":0,"orderPosition":-1,"isVisible":true,"expression":{"expressionType":0,"columnPath":"CreatedBy"}},"ModifiedOn":{"caption":"","orderDirection":0,"orderPosition":-1,"isVisible":true,"expression":{"expressionType":0,"columnPath":"ModifiedOn"}},"ModifiedBy":{"caption":"","orderDirection":0,"orderPosition":-1,"isVisible":true,"expression":{"expressionType":0,"columnPath":"ModifiedBy"}},"ProcessListeners":{"caption":"","orderDirection":0,"orderPosition":-1,"isVisible":true,"expression":{"expressionType":0,"columnPath":"ProcessListeners"}}}},"isDistinct":false,"rowCount":30,"rowsOffset":0,"isPageable":true,"allColumns":false,"useLocalization":true,"useRecordDeactivation":false,"serverESQCacheParameters":{"cacheLevel":0,"cacheGroup":"","cacheItemName":""},"queryOptimize":false,"useMetrics":false,"querySource":0,"ignoreDisplayValues":false,"conditionalValues":null,"isHierarchical":false}';
    return $json;
}
function JsonSelectEmailStatus($contactId){
    $json= '{
       "rootSchemaName":"Contact",
       "operationType":0,
       "filters":{
          "items":{
    		 "CustomFilters":{
    			"filterType":1,
    			"comparisonType":3,
    			"isEnabled":true,
    			"trimDateTimeParameterToDate":false,
    			"leftExpression":{
    			   "expressionType":0,
    			   "columnPath":"Id"
    			},
    			"rightExpression":{
    			   "expressionType":2,
    			   "parameter":{
    				  "dataValueType":0,
    				  "value":"'.$contactId.'"
    			   }
    			}
    		 }
    	  },
          "logicalOperation":0,
          "isEnabled":true,
          "filterType":6
       },
       "columns":{
          "items":{
             "DoNotUseEmail":{
                "caption":"Do not use email",
                "orderDirection":0,
                "orderPosition":-1,
                "isVisible":true,
                "expression":{
                   "expressionType":0,
                   "columnPath":"DoNotUseEmail"
                }
             }
          }
       },
       "isDistinct":false,
       "rowCount":30,
       "rowsOffset":0,
       "isPageable":false,
       "allColumns":false,
       "useLocalization":false,
       "useRecordDeactivation":false,
       "serverESQCacheParameters":{
          "cacheLevel":0,
          "cacheGroup":"",
          "cacheItemName":""
       },
       "queryOptimize":false,
       "useMetrics":false,
       "querySource":0,
       "ignoreDisplayValues":false,
       "conditionalValues":null,
       "isHierarchical":false
    }';
    return $json;
}

Unsubscription channels:

<?php
$contactId=$_GET['contactId'];
//contactId for test = 2480fb60-43d1-4a58-9011-0f859b431670 for test
require_once( MODX_CORE_PATH . 'model/bpmintegration/bpm_bulk_subscriptionsFunctions.php');
BPMAuth();
$jsonUseEmailQuery = JsonSelectEmailStatus($contactId);
$result = BPMQuery($jsonUseEmailQuery,4);
$r0 = json_decode($result,true);
$requestData1 = JsonSelectSubscriptions($contactId);
$result = BPMQuery($requestData1,4);
$r=json_decode($result, true);
$requestData1=JsonSelectdefaultchannels();
$result = BPMQuery($requestData1,4);
$r2=json_decode($result, true);
{//building html form 
    echo '<form method = "post" action = "/index.php?id=14&contactId='.$contactId.'">';
    if ($r0["rows"]["0"]["DoNotUseEmail"]==1) {
 
        echo '<h4>You are currently Unsubscribed from all emails, please uncheck Subscribe me back, if you wish to keep current setting on.</h4>';
        echo '<input type="checkbox" name="Subscribemeback" value="1" checked> Subscribe me back <br>';
    }
    echo '<h2>Subsctiption types</h2>';
    //print_r($r);
    foreach ($r["rows"] as $value) {
        echo '<input type="checkbox" style="display:none" name="SubscriptionData[]" value="'.$value["Id"].'" checked>';
        if ($value["BulkEmailSubsStatus"]["displayValue"]=='Subscribed'){
            echo '<input type="checkbox" name="CurrentSubscription[]" value="'.$value["Id"].'" checked> '.$value["BulkEmailType"]["displayValue"].'<br/>';
        }else{
            echo '<input type="checkbox" name="CurrentSubscription[]" value="'.$value["Id"].'"> '.$value["BulkEmailType"]["displayValue"].'<br/>';
        }
        } // Display channels already set for client
    foreach ($r2["rows"] as $value){
        foreach ($r["rows"] as $value1) {
            if ($value["Id"]==$value1["BulkEmailType"]["value"]){
                $exist=1;
            }
        }
     if (!$exist) {
         echo '<input type="checkbox" style="display:none" name="defaultsubscriptionschannels[]" value="'.$value["Id"].'" checked>';
         echo '<input type="checkbox" name="defaultsubscriptions[]" value="'.$value["Id"].'" checked> '.$value["Name"].'<br/>';
     } //if there is no such channel in basic subscription - echo some inputs
     else unset ($exist);
    } // Display Default Channels
    if ($r0["rows"]["0"]["DoNotUseEmail"]!=1) {
        echo ' <h2> OR Unsubscribe from all?</h2>
        <input type="checkbox" name="Unsibscribe_all" value="1"> Unsibscribe from all emails<br>';
    }
    echo '<input type="submit" value="Submit">
    </form>';
}//building form

Unsubscription channel request:

<?php
//$_POST['SubscriptionData']- array with all subscription preferances for current ContactID
//$_POST['CurrentSubscription'] - array with data to be subscribed
//$_POST['Defaultsubscriptions'] -array with default channels to add to subscriptions
//$_POST['defaultsubscriptionschannels'] - array with default channels
$contactId=$_GET['contactId'];
require_once( MODX_CORE_PATH . 'model/bpmintegration/bpm_bulk_subscriptionsFunctions.php');
BPMAuth();
if ($_POST['Subscribemeback']==1){
    $requestData1=ContactUnsubscribe($contactId,false);
    BPMQuery($requestData1,2);
    echo 'You were subscribed back';
}
if ($_POST['Unsibscribe_all']==1){
    $requestData1=ContactUnsubscribe($contactId,true);
    BPMQuery($requestData1,2);
    echo 'Unsubscribed from all';
    } // If Unsubscribed - post "Do no use email in BPM"
    else {
        echo '<h2>Subscription Channels were Updated</h2>';
        if (isset($_POST['CurrentSubscription'])){
            $filter=BuildIdFilter($_POST['CurrentSubscription']);
            $JsonSubscribe=BuildSubscribeJson($filter,true);// Json for Subscription Data
            BPMQuery($JsonSubscribe,2);
            $ToSetUnsubscribed=array_diff($_POST['SubscriptionData'],$_POST['CurrentSubscription']);//this is array to set unsubscribe status
            if (!empty($ToSetUnsubscribed)){
                 $filter=BuildIdFilter($ToSetUnsubscribed);
                 $JsonSubscribe=BuildSubscribeJson($filter,false);
                 BPMQuery($JsonSubscribe,2);
            }
        } 
        elseif(isset($_POST['SubscriptionData'])){
            $filter=BuildIdFilter($_POST['SubscriptionData']);
            $JsonSubscribe=BuildSubscribeJson($filter,false);
            BPMQuery($JsonSubscribe,2);//UpdateBPM
        }
        if (isset($_POST['defaultsubscriptionschannels'])){
            if (isset($_POST['defaultsubscriptions'])){
                $JsonSubscribe=JsonAddNewSubscriber($contactId,$_POST['defaultsubscriptions'],true);
                BPMQuery($JsonSubscribe,3);//UpdateBPM
                $ToAddUnsubscribed=array_diff($_POST['defaultsubscriptionschannels'],$_POST['defaultsubscriptions']);
                if (!empty($ToAddUnsubscribed)){
                    $JsonSubscribe=JsonAddNewSubscriber($contactId,$ToAddUnsubscribed,false);
                    BPMQuery($JsonSubscribe,3);//UpdateBPM
                    }
                }else{
                    $JsonSubscribe=JsonAddNewSubscriber($contactId,$_POST['defaultsubscriptionschannels'],false);
                    BPMQuery($JsonSubscribe,3);//UpdateBPM
                }
            }
        }// Defines array to add new subscription channels
?>

For additional assistance, see the video instruction at https://drive.google.com/file/d/1vJipUf0m04Mk_r3QLAakcwdXYtEon--J/view.

Like 2

Like

Share

0 comments
Show all comments

Hi, 

 

I want to call a business process from a script task of another business process. I did this because I want to send email to a collection of contacts, so I will do a foreach loop in the script task, and call the second business proces that will send the emails. 

The problem is that the second business process, its call from the first one, and appears in the process log as running, but it doesnt do anything, neither send the mail nor finish running. 

The script task code:

var _sendMailId = new Guid("451f9ef3-2a11-4ca8-9107-02e23e56f9f3");

var _manager = UserConnection.ProcessSchemaManager;

var _schema = (ProcessSchema)_manager.GetInstanceByUId(_sendMailId);

var _moduleProcess = _schema.CreateProcess(UserConnection);

_moduleProcess.Execute(UserConnection);



return true;

First business process: Mutiple email sender

 

 

Second Business process: MBS Send Email

Process log:

 

 

Thank you.

 

Javier Collazo

 

Like 0

Like

2 comments
Best reply

The problem here was that the business process that was call form the parent business process, wasn't receiving the parameter. The solution to this problem you can find it in the following question:



https://community.bpmonline.com/questions/calling-business-process-para…

 

Best regards, 

Javier

Hello,



At first you should be confident about business process that sends email is working properly. So, try to start it manually. If it will work, then something is wrong with your script task. Perhaps, you have just missed some parameters that are required in "MBS send email process" 

At second, try to save the process once again and compile the system.



Best regards,

Alex

The problem here was that the business process that was call form the parent business process, wasn't receiving the parameter. The solution to this problem you can find it in the following question:



https://community.bpmonline.com/questions/calling-business-process-para…

 

Best regards, 

Javier

Show all comments

Hello, is it possible to set up this functionality for portal users? Regular users can go to an Email Activities Detail in the cases section and click the + sign to create an email and send it. I was able to add the Email Activities Detail in the Portal Case Page, however there is no plus sign. See video for example.

 

http://recordit.co/8l1EsDXBbT

 

Like 0

Like

2 comments

Dear Mitch,

The portal users can only see the records in the detail. Apart from that, they need to have the access rights to see them. The basic functionality does not support sending the emails from the portal case page, and therefore it is not possible to add the email activity on the detail from portal. You will need to involve the development process to change the out-of-the-box logic of the application. 

Best regards,

Dean

Thank you Dean.

Show all comments