Agent Desktop

Get Involved. Join the Conversation.

Topic

    Joan Jones
    Do not email (cc) secondary contact
    Topic posted December 18, 2012 by Joan JonesBronze Trophy: 5,000+ Points 
    227 Views, 6 Comments
    Title:
    Do not email (cc) secondary contact
    Content:

    We have a scenario where we add a secondary contact to the incident but we don't want them to be cc'd for one reason or another. According to the documentation, "All contacts listed in that section [the contacts tab] will receive any response sent for that incident since they are either the primary contact or is a secondary contact." There does not appear to be a way to prevent this from happening as when I expand the notes tab, they aren't listed as a cc, but the email does get sent to them. Is the only way to prevent this from happening to remove them from the contacts tab?

    Comment

     

    • Ingrid De Kreuk

       This is something I also would like to know. I have looked if maybe I would have to make a rule in the incidents workspace which says that only primary contacts must receive an e-mail, but I could not find a way to make this happen. Does anybody have a solution?

    • Sathiya Kumar

      Hi,

      I am also facing same issue.Please share to me if you have solution.

      Other wise Do you have any idea to remove or unset secondary contact from incident using CPHP.

      Thanks,

    • Sathiya Kumar

      Hi,

      I am also facing the same issue. Please share to me if you have solution.

      Is any idea to remove or unset secondary contact from incident using CPHP ??

      Thanks,

      Sathiya

    • Ajay Yadav

      Not sure if you like this way but by using custom script you can send email only to primary contact and prevent alt email addresses,

      Steps :

      Deactivate message template for specific action like Incident Solved

      Write code to send email to contact

      make a business rule to run CPM code.

       

      CPM code to send email to contact :

      <?
      /*
      * CPMObjectEventHandler: Send_email_primary_contact
      * Package: RN
      * Objects: Incident
      * Actions: Create, Update
      * Version: 1.2
      * Purpose: Send email to primary contact.
      */
      //binds to the Connect PHP API
      use \RightNow\Connect\v1_2 as RNCPHP;
       
      //binds to the CPM Process Designer
      use \RightNow\CPM\v1 as RNCPM;
       
      //impementation
      class send_chat_transcript implements RNCPM\ObjectEventHandler
      {
      public static function apply ($run_mode, $action, $obj, $n_cycles)
      {
       
      //Default Field Values
      $inc_ref = $obj->ReferenceNumber;
      $inc_subj = $obj->Subject;
      $con_fname = $obj->PrimaryContact->Name->First;
      $con_lname = $obj->PrimaryContact->Name->Last;
       
      //Find and Set Primary email address used.
      $emails = $obj->PrimaryContact->Emails;
      if($emails)
      {
      foreach($emails as $each_email)
      {
      if(strcmp($each_email->AddressType->LookupName,"Email - Primary") == 0)
      {
      $con_email = $each_email->Address;
      }
      }
      }
       
      //build Message
      $html_message = "";
      $html_message = "Thank you for contacting us.<br/>
      Your feedback is valuable. Please tell us about your experience by simply clicking the link below and completing a brief survey.<br/>";
       
      $text_message = "";
      $text_message = "Thank you for contacting us.\n
      Your feedback is valuable. Please tell us about your experience by simply clicking the link below and completing a brief survey.<br/>";
       
      /*
      This section is for setting up the mail message
      */
      try
      {
      $mm = new RNCPHP\MailMessage();
       
      $mm->To->EmailAddresses = array($con_email);
      $mm->Subject = $inc_subj;
      $mm->Body->Text = $text_message;
      $mm->Body->Html = $html_message;
      /*
      send email only when there is chat transcript
      */
      $obj->save();
      $mm->send();
       
      if($mm->Status->Sent)
      {
      echo "Sent 1 ";
      }
      else
      {
      echo "Not Sent 1 ";
      }
      }
      catch (Exception $err)
      {
      echo "<br><b>Exception</b>: line ".__LINE__.": ".$err->getMessage()."</br>";
      /*if($mm->Status->Sent)
      {
      echo "Sent 2 ";
      }
      else
      {
      echo "Not Sent 2 ";
      }*/
       
      }
       
      }
      }
       
       
      //Test Harness
      class send_chat_transcript_TestHarness implements RNCPM\ObjectEventHandler_TestHarness
      {
      static $incident = null;
      static $incident_new = null;
       
      public static function setup()
      {
      $incident_new = RNCPHP\Incident::fetch(2635);
      static::$incident = $incident_new;
      return;
      }
       
      public static function fetchObject( $action, $object_type)
      {
      return(static::$incident);
      }
       
      public static function validate( $action, $object)
      {
      return true;
      }
       
      public static function cleanup()
      {
      static::$incident = null;
      }
      }
       
      ?>

       

      • Sathiya Kumar

        Thanks Ajay for your reply..!

        But system automatically send mail to secondary contact while agent saving the case from Agent Desktop.We couldn't stop that.

        Thanks,

        Sathiya

    • Ajay Yadav

      you can stop email from the message template and send email from CPM Only.

      example : if you don't want to send email to secondary contact when incident solve, then go to message template->Contact email,

      uncheck send next to incident solved