[SalesForce] Close Case If No Reply Within 48 Hours
How can I handle if customer doesn't reply within 48 hours of email sent to him and close the case automatically?
Best Answer
You can do this using nothing but configuration via the Process Builder.
Step 1: Create Timer Field
On the Case object, create a date time field with no default value.
Step 2: Create Process 1
In Process Builder, on the Email Message object, when the message is outgoing, update the parent case's Status to Waiting on Customer, and the Date Time field to the current time. If you're using Email-to-Case, you can also change the Status back to Working when an incoming message comes back from the customer.
Step 3: Create Process 2
In the Process Builder, on the Case object, when the Status is Waiting on Customer, set a delayed trigger for 48 hours after the date/time field from the first step, then set the Status to Closed.
Alternative:
You can do the same thing with regular Workflow Rules as well, the design would be nearly identical. Finally, if you really wanted to do it with code, you'd need a scheduled class that runs hourly to find cases to close. I'd recommend avoiding this path if you can help it.
If your organization requires users to share a common email alias, you can define a list of organization-wide addresses for each user profile. Organization-wide addresses define a common email address that a user profile can use. When sending email from Salesforce, users with these profiles can choose a different From address than the email address they have defined. Replies are delivered to the organization-wide address.
For example, assume your organization has several users under a single Support Profile. A Support Profile can be associated with an email address called support@acme.com and a Display Name of Acme Support. When Support Profile users send an outbound email through Salesforce, they can choose to have their From address appear as support@acme.com instead of their own Salesforce email address.
The highlighted sections in the following image represents the changes to the From address and Display Name that the recipient of an email might see:
After an organization-wide address is verified, it is available as a From address when sending an email or an email alert.
You have to add Case Thread Id field in the Subject line of the Email Template.
Once you've added this in the subject line (Close Email Template) it will basically pasre the ref Id in the subject line and it will attach that email to your case.
Best Answer
You can do this using nothing but configuration via the Process Builder.
Step 1: Create Timer Field
On the Case object, create a date time field with no default value.
Step 2: Create Process 1
In Process Builder, on the Email Message object, when the message is outgoing, update the parent case's Status to Waiting on Customer, and the Date Time field to the current time. If you're using Email-to-Case, you can also change the Status back to Working when an incoming message comes back from the customer.
Step 3: Create Process 2
In the Process Builder, on the Case object, when the Status is Waiting on Customer, set a delayed trigger for 48 hours after the date/time field from the first step, then set the Status to Closed.
Alternative:
You can do the same thing with regular Workflow Rules as well, the design would be nearly identical. Finally, if you really wanted to do it with code, you'd need a scheduled class that runs hourly to find cases to close. I'd recommend avoiding this path if you can help it.