简体   繁体   中英

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?

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. 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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