我使用osTicket开箱即用已经有几年了,它工作得很棒。我现在将这个系统用于我支持的一些医疗诊所,并且我添加了一个额外的字段,要求用户输入他们所在的诊所的名称。
这也是有效的,但我不知道如何将诊所的名称包括在自动电子邮件中,它告诉我的员工有一个新的门票开放。我想我需要添加一个新的基本变量,但不知道怎么做?有什么想法吗?
发布于 2012-01-12 01:30:46
我确实发现class.msgtpl.php (\include\class.msgtpl.php)的第32行说明了这一点:
$sql='SELECT * FROM '.EMAIL_TEMPLATE_TABLE.' WHERE tpl_id='.db_input($id);模板中是否有允许您使用自定义变量的内容?如果没有,您可以使用自己的代码编写,因为它可能只是一个简单的preg_replace。
发布于 2012-11-15 20:13:24
在include/class.ticket.php中,第422行
它们都在这个函数中。相应地添加到$search & $replace。
function replaceTemplateVars($text){
global $cfg;
$dept = $this->getDept();
$staff= $this->getStaff();
$search = array('/%id/','/%ticket/','/%email/','/%name/','/%subject/','/%topic/','/%phone/','/%status/','/%priority/',
'/%dept/','/%assigned_staff/','/%createdate/','/%duedate/','/%closedate/','/%url/');
$replace = array($this->getId(),
$this->getExtId(),
$this->getEmail(),
$this->getName(),
$this->getSubject(),
$this->getHelpTopic(),
$this->getPhoneNumber(),
$this->getStatus(),
$this->getPriority(),
($dept?$dept->getName():''),
($staff?$staff->getName():''),
Format::db_daydatetime($this->getCreateDate()),
Format::db_daydatetime($this->getDueDate()),
Format::db_daydatetime($this->getCloseDate()),
$cfg->getBaseUrl());
return preg_replace($search,$replace,$text);
}https://stackoverflow.com/questions/8823454
复制相似问题