Error class\RightNow\Connect\v1_2\MailMessage not found in custom process.
Version
Feb 14Code Snippet
<?php /** * CPMObjectEventHandler: AnswerNotification * Package: RN * Objects: Answer * Actions: Update * Version: 1.2 */ use \RightNow\CPM\v1 as RNCPM; // This object event handler binds to v1_2 of the Connect for PHP API use RightNow\Connect\v1_2 as RNCPHP; require_once(get_cfg_var("doc_root") . "/ConnectPHP/Connect_init.php"); error_reporting(E_ALL); class AnswerNotification implements RNCPM\ObjectEventHandler { public static function apply($runMode, $action, $answer, $cycle) { if ($cycle !== 0) return; if(RNCPM\ActionUpdate == $action) { try { print_r("hello"); $emailfrom = "[email protected]"; $to = "[email protected]"; $mm = new RNCPHP\MailMessage(); $mm->To->EmailAddresses = array($to); $mm->Subject = 'sub'; $mm->Body->Text = 'abc'; $mm->Body->Html = 'abc'; $mm->Options->IncludeOECustomHeaders = false; $mm->send(); echo "<br>Sent."; print_r($success); //mail sending logic } catch(Exception $e) { echo "ConnectPHP error was: ".$e->getMessage(); phpoutlog("ConnectPHP exception
0