diff --git a/module/bug/view/sendmail.html.php b/module/bug/view/sendmail.html.php
index 9700bb2ed2..bbc9fb1bd4 100644
--- a/module/bug/view/sendmail.html.php
+++ b/module/bug/view/sendmail.html.php
@@ -18,7 +18,7 @@
|
color) ? '#333' : $object->color;?>
- config->mail, 'domain', common::getSysURL()) . helper::createLink('bug', 'view', "bugID=$object->id", 'html'), $mailTitle, '', "style='color: {$color}; text-decoration: underline;'");?>
+ id", 'html'), $mailTitle, '', "style='color: {$color}; text-decoration: underline;'");?>
|
diff --git a/module/doc/view/sendmail.html.php b/module/doc/view/sendmail.html.php
index b26e031b90..df974bebde 100644
--- a/module/doc/view/sendmail.html.php
+++ b/module/doc/view/sendmail.html.php
@@ -18,7 +18,7 @@
|
color) ? '#333' : $object->color;?>
- config->mail, 'domain', common::getSysURL()) . helper::createLink('doc', 'view', "docID=$object->id", 'html'), $mailTitle, '', "style='color: {$color}; text-decoration: underline;'");?>
+ id", 'html'), $mailTitle, '', "style='color: {$color}; text-decoration: underline;'");?>
|
diff --git a/module/mail/model.php b/module/mail/model.php
index 80a174dcd6..a38e1dce2f 100644
--- a/module/mail/model.php
+++ b/module/mail/model.php
@@ -691,6 +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());
if($objectType == 'review' and empty($object->auditedBy)) return;
diff --git a/module/message/model.php b/module/message/model.php
index 27d92e820f..077429661a 100644
--- a/module/message/model.php
+++ b/module/message/model.php
@@ -72,8 +72,15 @@ class messageModel extends model
$actions = $messageSetting['mail']['setting'];
if(isset($actions[$objectType]) and in_array($actionType, $actions[$objectType]))
{
+ /* 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';
+
$moduleName = $objectType == 'case' ? 'testcase' : $objectType;
$this->loadModel('mail')->sendmail($objectID, $actionID);
+
+ if(defined('RUN_MODE') && RUN_MODE == 'api') $this->config->requestType = $requestType;
}
}
diff --git a/module/story/view/sendmail.html.php b/module/story/view/sendmail.html.php
index 47ba1948d5..c29caa7fc7 100644
--- a/module/story/view/sendmail.html.php
+++ b/module/story/view/sendmail.html.php
@@ -18,7 +18,7 @@
|
color) ? '#333' : $object->color;?>
- config->mail, 'domain', common::getSysURL()) . helper::createLink('story', 'view', "storyID=$object->id", 'html'), $mailTitle, '', "style='color: {$color}; text-decoration: underline;'");?>
+ id", 'html'), $mailTitle, '', "style='color: {$color}; text-decoration: underline;'");?>
|
diff --git a/module/task/view/sendmail.html.php b/module/task/view/sendmail.html.php
index b318101c13..7bab3c9557 100644
--- a/module/task/view/sendmail.html.php
+++ b/module/task/view/sendmail.html.php
@@ -18,7 +18,7 @@
|
color) ? '#333' : $object->color;?>
- config->mail, 'domain', common::getSysURL()) . helper::createLink('task', 'view', "taskID=$object->id", 'html'), $mailTitle, '', "style='color: {$color}; text-decoration: underline;'");?>
+ id", 'html'), $mailTitle, '', "style='color: {$color}; text-decoration: underline;'");?>
|
diff --git a/module/testtask/view/sendmail.html.php b/module/testtask/view/sendmail.html.php
index 073eb24259..11c88e80e5 100644
--- a/module/testtask/view/sendmail.html.php
+++ b/module/testtask/view/sendmail.html.php
@@ -18,7 +18,7 @@
|
color) ? '#333' : $object->color;?>
- config->mail, 'domain', common::getSysURL()) . helper::createLink('testtask', 'view', "testtaskID=$object->id", 'html'), $mailTitle, '', "style='color: {$color}; text-decoration: underline;'");?>
+ id", 'html'), $mailTitle, '', "style='color: {$color}; text-decoration: underline;'");?>
|