Cases: Set the status to "New" when replying to an email

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • animax
    Senior Member
    • Jun 2018
    • 155

    Cases: Set the status to "New" when replying to an email

    Hi, I have a question about the module "Cases".


    If I write an email from a case, this email will receive a case number in the subject line. If a person answers to this case number, the incoming email is assigned to the case.

    So far so good...


    My problem is that I do not see when an email response arrives.


    Other ticket systems usually work like this:
    When an email response to an existing ticket arrives, the status of the ticket is set to "New."

    How does EspoCRM work?

    Many Thanks.

    (A simple notification in the menu bar is not enough for me, I would like to be able to see in the list of cases that there is an email response)
  • partomas
    Active Community Member
    • Sep 2018
    • 331

    #2
    any solution for that?

    Comment

    • Maximus
      Senior Member
      • Nov 2018
      • 2731

      #3
      Hello,
      If you want to reopen a case after an email reply to an existing ticket arrived, you can create a new workflow to force reopen. Please follow these steps:
      1. Create a new workflow for the Email entity;
      2. Triger type: after record created
      3. Condition: if 'To EmailAddresses' has value 'email address of your Group Email Account that created this a case';
      4. Action: Update related record -> Parent -> Case -> Status -> your status.
      Note that this way will work only if an email will be in the same topic. A new email will create a new case.

      Comment

      • partomas
        Active Community Member
        • Sep 2018
        • 331

        #4
        Originally posted by Maximus
        Hello,
        If you want to reopen a case after an email reply to an existing ticket arrived, you can create a new workflow to force reopen. Please follow these steps:
        1. Create a new workflow for the Email entity;
        2. Triger type: after record created
        3. Condition: if 'To EmailAddresses' has value 'email address of your Group Email Account that created this a case';
        4. Action: Update related record -> Parent -> Case -> Status -> your status.
        Note that this way will work only if an email will be in the same topic. A new email will create a new case.
        Yes, it's works only if you have a "workflow" module. What to do for others? My suggestion is to add it to "standard" features.

        Comment

        • yuri
          Member
          • Mar 2014
          • 8440

          #5
          You can customize InboundEmail service class. This place https://github.com/espocrm/espocrm/b...Email.php#L487

          Add the following:
          PHP Code:
          
              if ($case->get('status') === 'Closed') {
                  $case->set('status', 'Assigned');
                  $this->getEntityManager()->saveEntity($case);
              } 
          

          I recommend extending the class in custom directory.
          If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

          Comment


          • Bashar
            Bashar commented
            Editing a comment
            @yuri,
            i have added this code, but the status of the ticket didn't set to "New" when someone response to an existing ticket.
            i don't have workflow.
        • Bashar
          Junior Member
          • Feb 2021
          • 11

          #6
          yuri

          #5.1

          Can you please help me?

          Comment

          Working...