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
nilannilan 

Trigger notification email when creating leads via API - Please help

Hi,

I am using the API to create leads in SF. To assign leads to a queue, I use the Ownerid field and set it to a relevant queue id. It’ is working well and leads are generated inside SF in that queue. But the problem is that the notification email is not sent any of the members of that specific queue. “Send Email to Members” check box is checked for this queue so it seems nothing wrong with the queue. Doesn’t the API trigger this email by default? Is there any thing should we set it to work? Please help

Thanks
Nilan
apexsutherlandapexsutherland

Hi Nilan,

 

I think that the "Send Email to Members" only works if you use the Lead Assignment Rules in the Salesforce point & click configuration area to assign the incoming Leads to queues. Assigning it directly to the queue using the API is a good idea, but unfortunately bypasses the  notification functionality.

 

Also, I think there is a "Use Assignment Rules" flag that you'll need to set in your API calls for the Lead Assignment Rules to fire properly and notify the queue members (sorry I don't have the exact info). 

 

Hope this helps,

 

Alex S. 

nilannilan

 

Thanks Alex,

I have setup an assignment rule and pass the rule id using the AssignmentRuleHeader object and setAssignmentRuleHeader method. It triggers the rule and leads are assigned to the particular queue. But email is still not triggered.

 

Nilan

Park Walker (TAGL)Park Walker (TAGL)

You can use the API to send the email yourself. You'll need to retrieve the queue (group) email address once the lead is assigned. You can then create the email in your code and send it using the API.

 

Park 

Message Edited by Redsummit on 07-08-2009 06:38 AM
SuperfellSuperfell
If you set the EmailHeader appropriately, it should trigger the email.
nilannilan
I have set the email header like below but it doesn’t trigger the mail. Any idea?  $header = new EmailHeader(true, true, true);

$client->setEmailHeader($header);

 

Thanks

Nilan

nilannilan

I used a lead Assignment rule with email template associated. So in that case we have to define the assignment rule header and the email header in the SOAP call something like below.

 

$header = new AssignmentRuleHeader($rule_id, false);

$client->setAssignmentRuleHeader($header);

$header = new EmailHeader(false, false, true); $client->setEmailHeader($header);

 

Thanks for your all help

 

Nilan