Changing the Status and Notifying a User on Case Update Emails via Workflows

    Overview

    Sugar®’s inbound email functionality allows emails to be automatically associated to existing cases when the email’s subject includes the case macro. When this occurs, it would be helpful for the status of the case to be updated to reflect that a customer’s response or input has been received. Additionally, the assigned user can be notified so they know to take action on the case. This article will walk through using workflows to perform both of these actions when an email is automatically added to an existing case.

    Beginning with version 9.1.0, each user’s license type (e.g. Sugar Serve) determines what functionality is available as described in the User Management documentation. The Workflow module used in this article is not available in Sugar Serve and Sugar Sell. 

    Prerequisites

    • You must be an administrator.
    • An inbound email account must be configured via Admin > Inbound Email to import incoming email messages.
    • A case macro must be configured via Admin > Inbound Email and the case macro must be included in the received email’s subject. For more information, please refer to the Automatically Associating Emails with Cases article.
    • Schedulers, specifically the Inbound Email Scheduler, must be running.
    • Sugar must be configured to send outbound emails via Admin > Email Settings.
    • You must create an email alert template for the Cases module. The assigned user will receive this message when the workflow is triggered. For more information, please refer to the Creating an Alert Email Template for Workflows article.

    For more information regarding these configurations, please refer to the Email, Schedulers, and Workflow Management documentation.

    Steps to Complete

    1. Navigate to Admin > Workflow Management.
    2. From the Workflow Management actions menu, select “Create Workflow Definition”.
    3. Populate the form fields as follows and then click “Save”.
      • Name : A descriptive name of your choosing, e.g. Notify user when email received 
      • Execution Occurs : When record saved
      • Target Module : Emails
      • Processing Order :Actions then Alerts
      • Status : Active
      • Applies To : New and Updated Records (Note: This field must be properly configured to prevent the workflow from firing before the email is related to the case, which would prevent identification of the user recipient associated with the case.)
      • Description : Workflow to update the case status and notify assigned user when an inbound email is related to a case
    4. Click “Create” on the Conditions subpanel to configure the first condition. Choose “When the target module changes” and then click “Save”.
    5. Proceed to the Alerts subpanel and click “Create”. Populate the form fields as follows and then click “Save”.
      • Name : Notify assigned user when email related to case
      • Alert Type : Email
      • Source Type : Custom Template
      • Custom Template : Choose the email alert template created as a precondition for this tutorial.
    6. Populate the Alert Recipient List.
      • Click “Create”.
      • In the popup window, choose “A user associated with a related module”.
      • Click the hyperlinked text, “Module”.
      • In the new popup window, select “Emails:Cases” from the dropdown menu and then click “Save”.
      • When returned to the previous window, click “Next”.
      • Choose “User who is assigned the record”.
      • Click the hyperlinked text, “type”.
      • In the popup window, choose address type “To:” and then click “Save”.
      • When returned to the previous window, click “Save” again.
    7. Navigate back to the Workflow Definition by clicking “Return to Workflow Definition”.
    8. Create an action in the Actions subpanel to update the case Status field.
      • Click “Create”.
      • In the popup window, choose “Update fields in a related module”.
      • Click the hyperlinked text, “record”.
      • In the popup window, choose “Cases” and then click “Save”.
      • When returned to the previous window, click “Next”.
      • Select the checkbox next to “Modify the field: Status”.
      • Click the hyperlinked text, “Status”.
      • In the popup window, choose the status you want the case to reflect when it updates (in this example, we chose “Assigned”) and then click “Save”.
      • When returned to the previous window, click “Save” again.

    The workflow definition is now complete and it should immediately start working the next time an email is received and contains the case macro in its subject line.

    Application

    To test the workflow, send an email to the Group Mail Account that includes the case macro and an existing case’s number (for example, [CASE:51]) in the subject of the email. When cron next runs on your server, the Check Inbound Mailboxes scheduler job will run. The unread email will be imported to Sugar and related to the appropriate case. This will update the case’s Status field to “Assigned”, and send an alert email to the user that is assigned to the case.

    in Workflows

    Reach out to us for help