Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/symfony/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Sugarcrm的电子邮件模板中添加自定义/关联字段_Sugarcrm - Fatal编程技术网

在Sugarcrm的电子邮件模板中添加自定义/关联字段

在Sugarcrm的电子邮件模板中添加自定义/关联字段,sugarcrm,Sugarcrm,我已经创建了一个名为surveys的自定义模块,它将与目标建立多对多关系。我需要在向目标发送活动邮件时插入调查名称 目前,我通过遵循电子邮件模板中的指南,在insert变量中填充了调查模块实体,但问题是它永远不会解析调查名称,并在发送的电子邮件中显示$survey_name 任何帮助/指导来解决这个问题 我刚刚在论坛上添加了答案。sugarCrm EmailTemplate模块基本上是很多代码,只需获得几个bean即可工作帐户、联系人、潜在客户、用户、潜在客户,我通过以下步骤获得一些与其他bea

我已经创建了一个名为surveys的自定义模块,它将与目标建立多对多关系。我需要在向目标发送活动邮件时插入调查名称

目前,我通过遵循电子邮件模板中的指南,在insert变量中填充了调查模块实体,但问题是它永远不会解析调查名称,并在发送的电子邮件中显示$survey_name


任何帮助/指导来解决这个问题

我刚刚在论坛上添加了答案。sugarCrm EmailTemplate模块基本上是很多代码,只需获得几个bean即可工作帐户、联系人、潜在客户、用户、潜在客户,我通过以下步骤获得一些与其他bean一起工作的模板,这些代码基于sugarCrm 6.0.2,class modules/Email.php论坛详细信息:

1让Email.php创建自己的bean。示例:LOC510

if (... $_REQUEST['parent_type'] == 'Prospects' || TRUE)
2创建替换字段的数组。示例:LOC521

  foreach($bean->field_defs as $key => $field_def) {
    $replace_fields ['$'.strtolower(get_class($bean).'_'.$field_def['name'])] 
    = $bean->$field_def['name'];
    //example of fieldnames: $bug_name, $bug_type, $case_date_created, $case_name, etc...
  }
3替换html模板上的字段。示例:LOC545

$this->description_html = str_replace(array_keys($replace_fields), $replace_fields, $this->description_html);
3替换txt模板上的字段。示例:LOC549

$this->description = str_replace(array_keys($replace_fields), $replace_fields, $this->description);