I am using the auto_core_update_email hook to modify the auto update email sent by WordPress. However I cannot figure out how to add line breaks to the email body. Here’s my code:
function example_filter_auto_update_email($email) {
$email['to'] = array('example@example.com', 'test@example.com');
$email['subject'] = 'Auto Update';
$email['body'] = 'Hello,%0D%0A'
. 'Lorem ipsum.%0D%0A'
. 'Many thanks,%0D%0A'
. 'WordPress';
return $email;
}
add_filter('auto_core_update_email', 'example_filter_auto_update_email', 1);
I have also tried using:
<br />
, \r\n
, as well as %0D%0A
, seen above. However, in each case the string is just printed in my email client like this:
Hello%0D%0ALorem Ipsum%0D%0AMany thanks%0D%0AWordPress
How can I get line breaks printed in my auto update emails? If it helps the emails are being sent by SMTP.
Thanks a lot!