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
bvoybvoy 

Case notification emails not triggering from assignment rules when creating a case via API

We have different notification email templates set up to fire for new cases. (Customize -> Cases -> Assignment Rules -> name of our standard set -> Edit for the given assignment rule entry.) Different kinds of cases get sent to different queues. We want the queue members to get notification emails, and this setup has worked fine for that for our Web-to-Case forms thus far.

 

I'm now transitioning us to using the PHP API instead (a few reasons, spam control being the primary one) and have things working. I'm using the following code just before creating the case to make sure the assignment rules are triggered:

 

$header = new AssignmentRuleHeader('', true);
$con->setAssignmentRuleHeader($header);

This seems to work well. Cases are assigned to the correct queues. Except email notifications are no longer being sent out, even though the queue ownership assignment is working fine. Any ideas why this might be? Is there another header flag I can set?

 

The workaround would be to have to create a corresponding workflow for every queue, but I figured I'd check if someone knows of a way to keep using just the Assignment Rules settings to make sure notifications get sent.

Best Answer chosen by Admin (Salesforce Developers) 
digamber.prasaddigamber.prasad

Hi,

 

I know we can set EmailHeader too while trying to insert case through api call. Could you please paste the code snippet which you are using to insert case record. I will take a look and will try to help you.

 

Happy to help you!

 

Regards,

Digamber Prasad

All Answers

digamber.prasaddigamber.prasad

Hi,

 

I know we can set EmailHeader too while trying to insert case through api call. Could you please paste the code snippet which you are using to insert case record. I will take a look and will try to help you.

 

Happy to help you!

 

Regards,

Digamber Prasad

This was selected as the best answer
bvoybvoy

Ah, thank you! EmailHeader is exactly what I was looking for.

 

For anyone looking for the same thing, here is SF documentation: http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_header_emailheader.htm

 

And a PHP-specific example (you do have to take an extra step in PHP of creating a specific header object to pass): http://wiki.developerforce.com/page/PHP_Toolkit_11.0_EmailHeader_Sample_(Partner)

digamber.prasaddigamber.prasad

Happy that it worked for you! :)

 

Could you please be kind enought to give me KUDOS, if above helped you.

 

Happy to help you!