mirror of
https://github.com/SuiteCRM/SuiteCRM-Core.git
synced 2025-09-13 00:42:08 +08:00
[Legacy] Add null checks to CaseUpdate sendUpdate
- check if email template is defined -- Don't send if not defined
This commit is contained in:
parent
53eb473130
commit
9f44d18fb4
1 changed files with 5 additions and 2 deletions
|
@ -606,6 +606,7 @@ class CaseUpdatesHook
|
|||
public function sendCaseUpdate(AOP_Case_Updates $caseUpdate)
|
||||
{
|
||||
global $current_user, $sugar_config;
|
||||
/**@var $email_template EmailTemplate*/
|
||||
$email_template = BeanFactory::newBean('EmailTemplates');
|
||||
|
||||
$module = null;
|
||||
|
@ -639,7 +640,8 @@ class CaseUpdatesHook
|
|||
$email_template = $email_template->retrieve($aop_config['contact_email_template_id']);
|
||||
$signature = $current_user->getDefaultSignature();
|
||||
}
|
||||
if ($email_template->id) {
|
||||
|
||||
if ($email_template && $email_template->id) {
|
||||
foreach ($caseUpdate->getContacts() as $contact) {
|
||||
$GLOBALS['log']->info('AOPCaseUpdates: Calling send email');
|
||||
$emails = [];
|
||||
|
@ -660,7 +662,8 @@ class CaseUpdatesHook
|
|||
$email_template = $email_template->retrieve($aop_config['user_email_template_id']);
|
||||
}
|
||||
$addDelimiter = false;
|
||||
if ($emails && $email_template->id) {
|
||||
|
||||
if ($emails && $email_template && $email_template->id) {
|
||||
LoggerManager::getLogger()->info('AOPCaseUpdates: Calling send email');
|
||||
$caseUpdate->sendEmail(
|
||||
$emails,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue