Results 1 to 3 of 3

Thread: Cases from inbound mail: How to assign to someone depending on the account?

  1. #1
    TheCodifier is offline Member
    Join Date
    Mar 2011
    Posts
    9

    Question Cases from inbound mail: How to assign to someone depending on the account?

    Hi all,

    I'm testing SugarCRM 6.1.2 Professional from the SugarCloud because my company consider to buy it and use it as our CRM software.

    We have a support email address in which our clients send support requests. Obviously, now, we can set up an inbound email account so that SugarCRM can create cases from the emails we receive. That works fine. The cases are even automatically assigned to a client (account) by Sugar depending of the origin of the email. So far so good.

    What I would like to do is to assign automatically the cases to the user who is assigned to the client (account) from which the email came. We are providing networking support and each of our big client have one of our employees assigned to it. If a client sends a support email, we would like that Sugar creates a case and assign it to our employee assigned to that client.

    In the account module, it's already possible to assign a user and a team. It would be great if the case assignation would consider those.

    The only options now are Round-Robin or Least Busy and the assigned user is picked from the Support team.

    Is it possible to do something like I described in Sugar Pro 6.1.2?

    Thanks,

  2. #2
    cefladental's Avatar
    cefladental is offline Sugar Community Member
    Join Date
    Jan 2010
    Location
    Charlotte, NC
    Posts
    51

    Default Re: Cases from inbound mail: How to assign to someone depending on the account?

    I want to do something similar to this. I have a custom field in Accounts that reflects which sales rep "owns" that client. When a client sends in a support request via Email, or one is entered by a support rep, and an association is made, I wand the sales rep to receive an Email that their client is either needing help or is getting help. Kinda keeps everyone in the loop.
    Brett Power

  3. #3
    TheCodifier is offline Member
    Join Date
    Mar 2011
    Posts
    9

    Default Re: Cases from inbound mail: How to assign to someone depending on the account?

    Hi cefladental,

    Since my post, I thought of a solution and tried it on a test server. I'll probably use it on our production SugarCRM instance.

    The best way to assign cases to someone who is responsible of a client is probably by a Logic Hook. I wrote a simple Logic Hook who check the user assigned to the client and then assign the case to that same user. An optional way to proceed is by having an array of clients and users like the one in comments in the code below.

    Code:
    class UpdateAssignedUserID
    {
        function updateAssignedUserID(&$bean, $event, $arguments)
        {
            global $db;
    
            // Array of clients and users - not used anymore			
            /*$clientsUsers = array(
                "2a2b81d3-9b70-067b-c56f-4d9b348cf330" => "d71fd47a-3e87-5e74-82f9-4d9c894ce647",
                "5ce004fd-973b-4fdd-e742-4d9c7a661771" => "2ea2f7db-d909-8995-7226-4d9c7cfeb422");*/
    	
            // Select all accounts id and assigned users			
            $query = "SELECT accounts.id, accounts.assigned_user_id FROM accounts";
            $results = $db->query($query, true);
    
            $rowNumber = 0;
            $clientsUsers = Array();
    
            // Copy each row in an aray			
            while ($row = $db->fetchByAssoc($results, $rowNumber))
            {
                $clientsUsers[$row['id']] = $row['assigned_user_id'];
                $rowNumber++;
            }
    
            // Find which client and assign the responsible user
            foreach ($clientsUsers as $clientID => $userID)
            {
                if ($bean->account_id == $clientID)
                {
                    $bean->assigned_user_id = $userID;
                }
            }
        }
    }
    EDIT: I reread your post and you say that you are talking about sending an email to the person who is responsible of the client. You can use a similar logic. You can loop through your clients to find the user you need and then send him an email. Here is a thread about sending an email in a logic hook: http://www.sugarcrm.com/forums/showthread.php?t=65541
    Last edited by TheCodifier; 2011-04-18 at 03:26 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Inbound e-mail account not working
    By nielsvanrikxoort in forum Help
    Replies: 3
    Last Post: 2009-02-12, 02:53 PM
  2. Auto Assign Account and Contact Details when Creating New Cases
    By velocity00723 in forum Developer Help
    Replies: 2
    Last Post: 2009-01-14, 09:54 AM
  3. Replies: 4
    Last Post: 2008-08-12, 10:39 PM
  4. Replies: 9
    Last Post: 2006-03-19, 03:23 PM
  5. Assign inbound E-Mail to existing Lead
    By sunside in forum Help
    Replies: 1
    Last Post: 2006-01-11, 12:56 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •