function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Praetorian65Praetorian65 

Case email auto-response

I have an auto response rule set up when a case is opened in salesforce. We are generating these through the API but it doesn't seem to work. It also doesnt work when adding a case through the salesforce UI. I added a debug log and it appears to be running the rule and sending the email but nothing actually happens:

*** Beginning Workflow Evaluation
User: ******* support
Start Time: 20090720104959.261
Starting All Rules Evaluation
Starting evaluation of rule type Assignment
Starting evaluation of rule type Response
[Case: #SL0609-000111 50020000006fnVH]
Rule Name: Ticket Responder
Evaluating Workflow Entry Criteria:
Rule entry order: 1
[Case : Status equals Opened]
Value found: Opened
Criteria evaluates to true
Spooling All Immediate Actions
[Case: #SL0609-000111 50020000006fnVH]
Response notify: ******* support, Email: support@******.com
Template: 00X200000016TbS
Ending All Rules Evaluation
Bulk Execute all Immediate Actions
Starting evaluation of rule type Workflow
Starting evaluation of rule type Escalation
End Time: 20090720104959.323
*** Ending Workflow Evaluation

 

Is there a setting that I have missed that will allow this to work? I haven't had any error messages for this (and yes, I edited the error message with asterisks for data security reasons).


Message Edited by Praetorian65 on 07-23-2009 08:16 AM
MarkSilberMarkSilber
You won't be able to trigger auto-response rules when creating a case via the UI or via the API. You would have to setup some sort of workflow or Apex trigger to notify the customer and mimic the functionality of auto-response rules. You also can't trigger auto-response rules when a user creates a case in the Customer Portal.

If I remember correctly from the last time I went down this path, the debug log will show as if it send the auto-response, even when it didn't.
TLFTLF

I ran into this issue recently myself. I was trying to create a Case from within an Apex trigger and have an auto-response rule send out an email. I saw the same behavior, in that the debug log seemed to indicate that all was well (my rule evaluated to true, and it correctly resolved the email template for the auto-response email), yet no emails were sent. I found a posting that suggested turning on the EmailHeader for auto response rules: http://community.salesforce.com/sforce/board/message?board.id=general_development&message.id=18250. So, in my trigger, I added this code:

 

Database.DMLOptions opts = new Database.DMLOptions(); opts.EmailHeader.triggerAutoResponseEmail = true; Case checkInCase = new Case(); checkInCase.OwnerId = u.Id; checkInCase.ContactId = primaryContact.Id; checkInCase.AccountId = opp.AccountId;

.

.

.

insert checkInCase;

 

 

This did the trick for me. Now my Case is generating the auto-response email I'm expecting. Hope this saves someone some time.

TLFTLF

Oops! I forgot an important line in my code snippet (the line that sets the DMLOptions!):

 

Database.DMLOptions opts = new Database.DMLOptions(); opts.EmailHeader.triggerAutoResponseEmail = true; Case checkInCase = new Case(); checkInCase.OwnerId = u.Id; checkInCase.ContactId = primaryContact.Id; . . . checkInCase.setOptions(opts); insert checkInCase;