0

I'm trying to alter the output of webform submissions in emails. At the moment, I'm just looking for the correct function. I can see there is a hook to alter the rendered output, which is being hit, but it is not changing the output of the emails. Am I replacing the Theme function in the correct place?

function seven_webform_submission_render_alter(&$renderable) {
  $renderable['#theme'] = 'seven_webform_submission_table';
  dpm($renderable);
  kpr($renderable);
}

function  seven_webform_submission_table($node, $submission, $email, $format) {
  return 'test';
}
1
  • there is little confusion about query. what u actually want?
    – monymirza
    Commented Mar 26, 2013 at 5:24

2 Answers 2

1

The hook you are looking for is hook_mail_alter.

To modify webform submissions emails your code should look like:

function MYMODULE_mail_alter(&$message){
  if ($message['module'] == 'webform' && $message['key' == 'submission']){
    /*** Place your code here ***/
  }
}

This will alter just the webform submissions emails.

1
  • 1
    Your code is wrong wrongly formated, this is how it should look. function MYMODULE_custom_mail_alter(&$message){ if ($message['module'] == 'webform' && $message['key'] == 'submission'){ dpm($message); } }
    – Blissful
    Commented Sep 15, 2013 at 11:48
1

Read Documentation here that may help you.

Customising the emails sent by webform

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.