简体   繁体   English

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

[英]Remove pagebreak fields in Drupal Webform submission email

I currently have the following as an output in my email, and wish to remove the pagebreaks from the email that gets sent. 我目前在电子邮件中有以下输出,并希望从发送的电子邮件中删除分页符。

Any idea what I need to put in webform-mail.tpl.php? 任何想法我需要放在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

EDIT 编辑

I have tried Ayush's solution in my theme template.php, plus webform-mail.tpl.php and webform.module to no success. 我已经在主题template.php中尝试了Ayush的解决方案,再加上webform-mail.tpl.php和webform.module都没有成功。 ANyone have any ideas? 有人有想法么?

那么你需要把一个自定义模块中,像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]);
      }
    }
  }
}
?>

see this 看到这个

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

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