Extra white space in emails
-
It appears there is some extra white space being added to the emails. For some reason a <br> breaking space tag is appended on to each line in the email. It adds extra space when using ContactForm 7 due to the following lines in includes/mail.php.
$header = apply_filters( 'wpcf7_mail_html_header', '<!doctype html> <html xmlns="https://www.w3.org/1999/xhtml"' . $lang_atts . '> <head> <title>' . esc_html( $this->get( 'subject', true ) ) . '</title> </head> <body> ', $this ); $footer = apply_filters( 'wpcf7_mail_html_footer', '</body> </html>', $this );
If I replace it and remove the \n from the strings it does not append <br> after html, head, title, and body tags.
$header = apply_filters( 'wpcf7_mail_html_header', '<!doctype html><html xmlns="https://www.w3.org/1999/xhtml"' . $lang_atts . '><head><title>' . esc_html( $this->get( 'subject', true ) ) . '</title></head><body>', $this ); $footer = apply_filters( 'wpcf7_mail_html_footer', '</body></html>', $this );
- The topic ‘Extra white space in emails’ is closed to new replies.