diff --git a/module/mail/model.php b/module/mail/model.php index a38e1dce2f..ceff7b3dee 100644 --- a/module/mail/model.php +++ b/module/mail/model.php @@ -691,7 +691,7 @@ class mailModel extends model $nameFields = $this->config->action->objectNameFields[$objectType]; $title = zget($object, $nameFields, ''); $subject = $this->getSubject($objectType, $object, $title, $action->action); - $domain = defined('RUN_MODE') && RUN_MODE == 'api' ? '' : zget($this->config->mail, 'domain', common::getSysURL()); + $domain = (defined('RUN_MODE') and RUN_MODE == 'api') ? '' : zget($this->config->mail, 'domain', common::getSysURL()); if($objectType == 'review' and empty($object->auditedBy)) return; diff --git a/module/message/model.php b/module/message/model.php index 077429661a..a1e9d87f34 100644 --- a/module/message/model.php +++ b/module/message/model.php @@ -74,13 +74,13 @@ class messageModel extends model { /* If it is an api call, get the request method set by the user. */ global $config; - $requestType = $this->config->requestType; - if(defined('RUN_MODE') && RUN_MODE == 'api') include $this->app->getConfigRoot() . 'my.php'; + $requestType = $config->requestType; + if(defined('RUN_MODE') and RUN_MODE == 'api') include $this->app->getConfigRoot() . 'config.php'; $moduleName = $objectType == 'case' ? 'testcase' : $objectType; $this->loadModel('mail')->sendmail($objectID, $actionID); - if(defined('RUN_MODE') && RUN_MODE == 'api') $this->config->requestType = $requestType; + if(defined('RUN_MODE') and RUN_MODE == 'api') $config->requestType = $requestType; } }