Skip to content

Commit

Permalink
[not verified] Fix: Plaintext not showing spaces in emails (#27723)
Browse files Browse the repository at this point in the history
  • Loading branch information
sdixon194 committed Dec 1, 2022
1 parent 8040172 commit 5dc22f5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: bugfix

Form block: Add line breaks back to plain text email submissions.
Original file line number Diff line number Diff line change
Expand Up @@ -3810,6 +3810,9 @@ public static function add_plain_text_alternative( $phpmailer ) {
// Convert <br> to \n breaks, to preserve the space between lines that we want to keep
$alt_body = str_replace( array( '<br>', '<br />' ), "\n", $alt_body );

// Convert <div> to \n breaks, to preserve space between lines for new email formatting.
$alt_body = str_replace( '<div', "\n<div", $alt_body );

// Convert <hr> to an plain-text equivalent, to preserve the integrity of the message
$alt_body = str_replace( array( '<hr>', '<hr />' ), "----\n", $alt_body );

Expand Down

0 comments on commit 5dc22f5

Please sign in to comment.