+ Reply to Thread
Results 1 to 5 of 5

Thread: Trigger notification email when creating leads via API - Please help

  1. #1

    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

  2. #2
    Join Date
    May 2007
    Posts
    502
    Blog Entries
    3
    I have never used this function Nilan, but I will look into it and see if I can help you out. I would think that there would need to be some sort of workflow or switch that needs to be turned on when a new lead comes into the the system. I also think that you could do this via PHP. If you create a new record via php, you could send an email out to an array of users or a list of users via something like this:

    PHP Code:
    $result $client->create(array($sObject));

    $message =  'A new record has been created, please login and check it out';

    if (
    $result->success)
    {
           
    mail('me@email.com''new lead in salesforce'$message);

    Or you could even run a live query in your script to Salesforce with the new Id that you just created and get the owner ID, which would then get you the email from the Account object and then send the email out to that owner



    ~Mike

  3. #3
    I wonder whether why the API doesn’t trigger this email by default. Yes, as you mentioned we can trigger our own mail but in each time a new member is added to that queue we have to add that email address to our list which is not that much practical. Anyway thank you very much for your consideration. Please post if you find any clue regarding this issue.

    Thanks,
    Nilan

  4. #4
    Join Date
    May 2007
    Posts
    502
    Blog Entries
    3
    Not if you get the owner Id from the user table using a live query? Why not do that? That way you can get the email address from there

  5. #5
    Thanks Mike,

    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);

    It works fine.

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

SEO by vBSEO 3.5.0 RC1 PL1