I have a problem when ever I update case it stucks and does not do further forward and does not send email that I have hardcoded.
Logic hook is given below:
$hook_array['after_save'][] = Array(13, 'send email', 'custom/modules/Cases/Logic_Hook_Classes/work_flows.php','work_flows', 'work_flows_execute');
It’s code is given below:
class work_flows{
function work_flows_execute($emailSubject, $emailBody){
$emailObj = new Email();
$defaults = $emailObj->getSystemDefaultEmail();
$mail = new SugarPHPMailer();
$mail->setMailerForSystem();
$mail->From = $defaults['email'];
$mail->FromName = $defaults['name'];
$mail->ClearAllRecipients();
$mail->ClearReplyTos();
$mail->Subject=from_html($emailSubject);
$mail->Body=$emailBody;
$mail->AltBody=from_html($emailBody);
$mail->prepForOutbound();
$mail->AddAddress("fozangill@outlook.com");
@$mail->Send();
mail("fozangill@outlook.com","sub","mesage");
}
}
None of method working.