Results 1 to 2 of 2

Thread: Case workflow question

  1. #1
    chrislynch8's Avatar
    chrislynch8 is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Cork, Ireland
    Posts
    747

    Default Case workflow question

    Hi,

    When I create a Case I want to email the related Contact with the Case details and its progress. How do I say in a workflow to sent an Email alert to the realted contact of the case that has triggered the workflow?

    Rgds
    Chris

  2. #2
    mvngti is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    South Africa
    Posts
    510

    Default Re: Case workflow question

    I don't think this can be done by the workflow module.

    You will need to create a before_save logic hook on the Case module that does:
    1. Create a Contact object
    2. Retrieve the related Contact
    3. Create an Email object
    4. Populate the Email object
    5. Send the Email


    Something like:
    PHP Code:
    require_once "modules/Contacts/Contacts.php";
    require_once 
    "modules/Emails/Emails.php";
    $contact = new Contact();
    $email = new Email();
    $contact->retrieve($bean->contact_id);
    $email->text $case->resolution
    $email
    ->subject $bean->case_number " " $bean->name;
    $email->to_addrs $contact->EmailAddress->GetPrimaryAddress();
    $email->Send(); 
    This is definitively not a complete example but should get you started.
    Use the editLogicHooks tool in my signature to create the logic hook for you if you do not know how.

    M
    --


    Marnus van Niekerk

    There are only 10 types of people in the world
    those who can read binary and those who don't

    Modules:
    CE Teams - Upgrade safe teams module for Community Edition
    FieldACL - Field Level Access Control for Community Edition
    EditLogicHooks - Create and edit Logic Hooks from the Admin GUI
    FlexibleChartDashlet - Display any data in a Dashlet Chart
    DocumentThumbnails - Thumbnails for Documents module

    Many questions can be answered by reading the Developers Manual

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Workflow question
    By adamguerin in forum Help
    Replies: 2
    Last Post: 2009-01-26, 11:46 PM
  2. Workflow question
    By andymac in forum General Discussion
    Replies: 0
    Last Post: 2008-01-18, 07:55 PM
  3. Workflow question
    By andymac in forum Developer Help
    Replies: 0
    Last Post: 2008-01-18, 07:53 PM
  4. workflow question>
    By andramine in forum Help
    Replies: 0
    Last Post: 2007-02-16, 06:35 PM
  5. How do i add the Case id to alert emails during workflow??
    By tenaciousd in forum General Discussion
    Replies: 1
    Last Post: 2006-03-28, 01:57 AM

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
  •