Download & Extend

Trouble adding "Subject" in themed headers

Project:Webform
Version:6.x-3.4
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Specifying a "Subject" in theme_webform_mail_headers() results in an email whose subject line reads simply "default." The problem seems to be in these lines in webform_client_form_submit():

<?php
     
// Update the subject if set in the themed headers.
     
if (isset($email['headers']['Subject'])) {
       
$email['headers']['subject'] = $email['headers']['Subject'];
        unset(
$email['headers']['Subject']);
      }
      else {
       
$email['subject'] = webform_format_email_subject($email['subject'], $node, $submission);
      }
?>

The mail function uses $email['subject'], not $email['headers']['subject']. Rewriting the above worked for me:

<?php
     
// Update the subject if set in the themed headers.
     
if (isset($email['headers']['Subject'])) {
       
$email['subject'] = $email['headers']['Subject'];
        unset(
$email['headers']['Subject']);
      }
      else {
       
$email['subject'] = webform_format_email_subject($email['subject'], $node, $submission);
      }
?>

Comments

#1

Patch to fix the issue reported above.

AttachmentSize
webform-964448.patch 710 bytes

#2

Weird, I thought we fixed this exact problem once before. Change looks right to me.

#3

Status:needs review» reviewed & tested by the community

Yup, it's right. Look at the similar 'from' block just above.

(Problem traced independently, then found this patch & tested.)

#4

Status:reviewed & tested by the community» closed (fixed)

We've fixed this issue already separately from this issue. The change looks like it's already in the current version.

nobody click here