Details
Description
Create a mailing without html header and (or) footer, send it (immediately), go to the report page, "View complete message" pop-ups your message, refresh the report page and you obtain :
"""
Notice: Undefined variable: htmlHeader in CRM_Mailing_BAO_Mailing->getMailingContent() (line 2329 of /var/www/drupal/sites/all/modules/civicrm/CRM/Mailing/BAO/Mailing.php).
Notice: Undefined variable: htmlFooter in CRM_Mailing_BAO_Mailing->getMailingContent() (line 2329 of /var/www/drupal/sites/all/modules/civicrm/CRM/Mailing/BAO/Mailing.php).
"""
In /var/www/drupal/sites/all/modules/civicrm/CRM/Mailing/BAO/Mailing.php, the htmlHeader (and htmlFooter) var is initialized into a conditionnal if block but is used outside of it:
/var/www/drupal/sites/all/modules/civicrm/CRM/Mailing/BAO/Mailing.php line 2305
"""
if ($report['mailing']['header_id'])
...
echo $htmlHeader . $report['mailing']['body_html'] . $htmlFooter;
"""
a quick solution could be to initialize those vars to void before using if blocks like in the attached diff file