繁体   English   中英

删除Drupal Webform提交电子邮件中的分页符字段

[英]Remove pagebreak fields in Drupal Webform submission email

我目前在电子邮件中有以下输出,并希望从发送的电子邮件中删除分页符。

任何想法我需要放在webform-mail.tpl.php中吗?

Application form completed on Wednesday, February 2, 2011 - 14:17 by 69.10.172.83

--Next--
--Next--
--Next--
--Next--
--Next--
Total: £0

Your personal reference number is: WSE93

编辑

我已经在主题template.php中尝试了Ayush的解决方案,再加上webform-mail.tpl.php和webform.module都没有成功。 有人有想法么?

那么你需要把一个自定义模块中,像mymodule.module名为mymodule_webform_submission_render_alter(&$renderable) ,使其工作。

<?php
function hook_webform_submission_render_alter(&$renderable) {
  // Remove page breaks from sent e-mails.
  if (isset($renderable['#email'])) {
    foreach (element_children($renderable) as $key) {
      if ($renderable[$key]['#component']['type'] == 'pagebreak') {
        unset($renderable[$key]);
      }
    }
  }
}
?>

看到这个

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM