How to reopen a case automatically when a new email is received(using Process Definitions)?

Hi,

I'm using Sugar 8.0.3 Enterprise, how can i re-open an existing  closed case(Status: Closed) when a new email imported via email to case functionality has the matching Case Number[Case Macro]  on the subject ?

I note that Emails is not a module that can be configured for the Process Definitions(SugarBPM) in Sugar 8x , however it is on Sugar 10x


Regards,

Vijay

  • Sugar 8 hits EOL in October, so I strongly recommend you plan an upgrade for this customer.

    If that is not an option, here are some I can think of:

    • Create a SugarLogic field on the Cases module which counts the number of related Emails. Then design a SugarBPM process def which listens for a change on that newly created SugarLogic field, and reopens the case accordingly if it is closed.
    • Legacy Workflow (can't recall if its already blocked in v10) - but an "after time elapses" one can pick up the condition of a new email where a related case status = closed.
    • A logic hook.

    Good luck!

    Adam

  • Thanks , i want to avoid any customisation involved and the use of legacy workflows. We have plans to upgrade sugar to the latest version in the short term and stick to manual workarounds for the time being. I'm going to try this on v10 instance and see if this is Out of the Box,  as this could be a standard Cases management scenario. Cheers !

  • Create a SugarLogic field on the Cases module which counts the number of related Emails.

    Emails is not listed as one of the related modules that show up on Studio to set up the Rollup Count(as a calculated field), both on Sugar 8x and Sugar 10x. So i guess , customisation via code is the only way ?

  • Hi Vijay,

    Direct coding is not the only way
    There is a possibility to design logic hooks instead of developing them.

    I used Logic Builder tool for Sugar to design the logic:


    Literally: on the Email is related to the Case in Sugar, to check the Status of the Case and if it is Closed, then to change the Status to Open and save the Case with new Status

    In a click, the Logic Builder tool generates Sugar code on the basis of the design and provides code as a ready-to-install Sugar package, so that admin could deploy it to  Sugar via Module Loader

    Here is the package for the logic described on the picture: 

    z20200914_flowchart_lb5f5f314e4ec069_36260447_2.zip

    Its upgrade safe and cloud-compatible, so you might reuse it for future versions.

    I have no v8 to test the package, so I'd suggest to try it on the sandbox prior to installing it to prod.
    Let me know if you have any questions

    All the Best,
    Dmytro

    Best Regards,
    Dmytro Chupylka

    integroscrm.com
    We make work in Sugar CRM system faster, more convenient and efficient

  • Hi I tried to upload the zipfile in our module loader but I got to see the notification that the zipfile is not supported by our Sugar Suite, maybe because it is only compatible for Sugar 8?  Is there a Sugar BPM template for reopening a case when an email is sent?

    Thank you in advance for your answer.

    Best regards,

    Maike  

  • Hi Malke,

    LogicBuilder-generated zips along the one I've provided here, are compatible with all stacks of original Sugar from SugarCRM company - starting Sugar version 7 and till modern 12

    Could you share the Sugar version is mentioned on the About page of your CRM instance?

    Best Regards,
    Dmytro Chupylka

    integroscrm.com
    We make work in Sugar CRM system faster, more convenient and efficient

  • Hi Dmytro, thank you for your quick response. We currently got this version of Sugar: 

    Version 12.0.0 (Build 265) (Q2 2022)
    With license for: 
    • Sell Advanced

    Thanks again for your reply.

    Best regards,

    Maike 

  • ah, okay - v10 was the latest Sugar version at the moment the file is created, so now I've added v11 and v12 into manifest.php and refreshed zip in the post - try to re-download file and install it

    Best Regards,
    Dmytro Chupylka

    integroscrm.com
    We make work in Sugar CRM system faster, more convenient and efficient

  • Hi ,

    I don't consider SugarBPM a suitable solution for this use case. We have had similar requirements from other customers, and we solved this with custom logic hooks. The reason for this is that emails received on a case after it is closed do not always warrant reopening. Here are some of the factors we have had to consider:

    • Is the email received the case from an address outside your company's domain? Sugar users typically don't want a case reopened if it is their own employee sending an email in relation to the case. SugarBPM does not offer a direct way to evaluate the domain of the email sender.
    • Is the email received an actual request to continue working the case or is it non-actionable? Your customers may reply with a simple 'thanks' after the case has been closed. If monitoring case KPIs is important, reopening cases in these scenarios would mean you are measuring a longer resolution time than what actually occurred since the agent would need to re-close the case. We advise flagging the case for review to see if a received inbound email necessitates the case being reopened.
    • Is the email received significantly beyond the case closure (e.g. 30+ days)? Reopening cases in these scenarios not only impacts case performance metrics, but also may be for an unrelated issue. SugarBPM does not have efficient means to safeguard against reopening a case based on the amount of time elapsed since that case was closed. Like the prior issue, we advise to flag the case for review and the agent can determine whether to reopen a case, create a new case, or to take no action.

     may be able to provide you a solution that meets your needs, but if not, I would not recommend pursuing SugarBPM for this use case. Custom logic hooks would be a better alternative approach from my perspective.

    Chris

  • Personally,

    We did a logic hook in the Emails module which triggers when an email is related to a Case.

    We do a lot more than what's below, check for inbound vs outbound, check if it was from an email in our domain or not, check which department it's assigned to (tech support vs info vs documentation feedback etc...), verify that it was not closed as Spam etc... but I boiled it down to basics below, you can add your own logic to it.

    $hook_array['after_relationship_add'][] = array(1,'email_case_relationship','custom/modules/Emails/email_case_handling.php','EmailCaseHandling','update_on_relationship',);

    <?php
    class EmailCaseHandling
    {
       // If the Email is inbound and RELATED to a case, reopen the case and notify the assigned user
       function update_on_relationship ($bean,$event,$arguments){
          //bean = Email
          //case retrieved from related_id
          if ($arguments['related_module'] =='Cases'){
             $case = BeanFactory::retrieveBean('Cases', $arguments['related_id']);
             if($bean->type == 'inbound'){
                //case FROM  customer (not from an internal address)
                $case->status = 'Open';
                $case->save();
                //notify assigned users using custom script that composes the email and sends it via Mailer factory
                //we use the same notify_assigned_user to send notifications about various events on the case and found it practical to have reuseable code. 
                //Mailer factory https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_12.0/Architecture/Email/Mailer_Factory/
                   notify_assigned_user($case, $bean, "Inbound Email on Closed Case");
             }
          }
       }
    }
    ?>

    FrancescaS