If the incoming email subject contains an existing case number, the email should get attached to that case and case owner is notified. can any one suggest me on how to implement this.
1 Answer
I'm assuming you asking how to do what is in your question...
To setup email to case to auto associate replies to the correct Case enable go to Cases > Email-to-Case and select include the thread id in either the email subject or body. Salesforce will then automatically include it on any emails sent by a Salesforce user (not an auto response though). Any inbound emails with a thread id will then be associated to it's correct Case.
To notify the user depends a little on your process. I've seen some companies who Close a Case on reply (preventing it being open if they don't get a reply) or a use a status of "awaiting customer response". You could then use a workflow rule on inbound email to change the status of the Case (for example "Customer responded") so it appears back in the user's "My open Cases" view or you could email them from the same workflow rule. Depending on the number of emails you get the former may be preferred in preventing lots of emails being sent to the Salesforce user. This is nearly always my preferred option for anything that could have a decent volume as it then prevents the user seeing any urgent email alerts.
Note you will need an email to case address setup before you can use the email message object in workflow rules.
I have personally hit a limitation with this where the customer is also using email to case and it includes their thread id already. More info: email to case interchanging case emails between salesforce orgs
If you don't want to use the standard thread id and want to support the case number only then you will need to build your own custom email handler, which I won't go into detail here but you can find some documentation here: https://developer.salesforce.com/page/An_Introduction_To_Email_Services_on_Force.com