Title: Linebreaks Missing
Last modified: November 29, 2016

---

# Linebreaks Missing

 *  [dhirnitish](https://wordpress.org/support/users/dhirnitish/)
 * (@dhirnitish)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/linebreaks-missing/)
 * Hello,
 * I am using this plugin to send all emails via sendgrid. My main plugin is memberpress.
   All the notification emails have been missing linebreaks. I have tested the mail
   settings in sendgrid account and plugin settings as well.
 * Nothing helps. All the linebreaks with \n \n are missing.
 * Thanks

Viewing 15 replies - 1 through 15 (of 21 total)

1 [2](https://wordpress.org/support/topic/linebreaks-missing/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/linebreaks-missing/page/2/?output_format=md)

 *  Anonymous User 12640152
 * (@anonymized-12640152)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/linebreaks-missing/#post-8492756)
 * Hi [@dhirnitish](https://wordpress.org/support/users/dhirnitish/),
 * Please enable the ‘Plain Content’ option from your account’s settings ( [https://app.sendgrid.com/settings/mail_settings](https://app.sendgrid.com/settings/mail_settings))
   and see if it works this way. Unfortunately we can’t test that very plugin to
   see the compatibility.
 * Please keep us posted.
 * Thank you,
    SendGrid
 *  Thread Starter [dhirnitish](https://wordpress.org/support/users/dhirnitish/)
 * (@dhirnitish)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/linebreaks-missing/#post-8493094)
 * Hello,
 * I have enabled the option already. Its not just with that plugins but everything.
   Every single email that goes out of my site is missing linebreaks.
 * Thanks
 *  Anonymous User 12640152
 * (@anonymized-12640152)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/linebreaks-missing/#post-8519565)
 * Hello,
 * We can’t reproduce your issue. Please let us know what other plugins are you 
   using to see if there is a incompatibility.
 * Thank you,
    SendGrid
 *  [Kieran](https://wordpress.org/support/users/naughtybiscuit/)
 * (@naughtybiscuit)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/linebreaks-missing/#post-8520745)
 * I too have the same issue, it’s completely stripping the P tag
 * It happens to all emails WordPress & plugin alike. So instead of getting the 
   layout here where I have the dropline I am getting something like the below.
 * “I too have the same issue, it’s completely stripping the P tag It happens to
   all emails WordPress & plugin alike. So instead of getting the layout here where
   I have the dropline I am getting something like the below.”
 *  Thread Starter [dhirnitish](https://wordpress.org/support/users/dhirnitish/)
 * (@dhirnitish)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/linebreaks-missing/#post-8520805)
 * @team-rs Its very unlikely that you were not able to reproduce the issue. Well
   i made a code change and it fixed things for me.
 * The change has been done in the following file:
    /lib/sendgrid/class-sendgrid-
   api.php
 * `$fields['html'] = nl2br($fields['html']);`
 * Add the above line on line number 28. Maybe you guys can integrate it with a 
   checkbox in the settings for all the people who face this issue. Because there
   are a lot!
 *  [Kieran](https://wordpress.org/support/users/naughtybiscuit/)
 * (@naughtybiscuit)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/linebreaks-missing/#post-8520828)
 * For purposes of debugging:
 * **WordPress Version**: 4.6.1
    **PHP**: 7.0.13 **Error Log**: Clear **Content-
   Type**: text/html **SendGrid**: Latest **Other plugins**: Tested both with and
   without plugins **Theme**: KLEO, also tested with Twenty Sixteen, Twenty Fifteen
   and Twenty Fourteen **Sending through email test**: Respects the HTML used, b
   p i etc. **Other**: Test with “Plain Content” on in settings, no change.
 *  Thread Starter [dhirnitish](https://wordpress.org/support/users/dhirnitish/)
 * (@dhirnitish)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/linebreaks-missing/#post-8520838)
 * [@naughtybiscuit](https://wordpress.org/support/users/naughtybiscuit/) Try the
   change i made. It works well for me.
 *  [Kieran](https://wordpress.org/support/users/naughtybiscuit/)
 * (@naughtybiscuit)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/linebreaks-missing/#post-8520859)
 * Hi [@dhirnitish](https://wordpress.org/support/users/dhirnitish/),
 * I hadn’t seen your reply at the time I pressed submit, I am about to try it now.
   To confirm insert `$fields['html'] = nl2br($fields['html']);` above line 28, 
   so it should look like
 *     ```
       public function send(SendGrid\Email $email) {
           $fields    = $email->toWebFormat();
           $fields['html'] = nl2br($fields['html']);
           $headers = array();
       ```
   
 * Is that correct?
 *  Thread Starter [dhirnitish](https://wordpress.org/support/users/dhirnitish/)
 * (@dhirnitish)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/linebreaks-missing/#post-8520863)
 * Yes [@naughtybiscuit](https://wordpress.org/support/users/naughtybiscuit/)
 *  [Kieran](https://wordpress.org/support/users/naughtybiscuit/)
 * (@naughtybiscuit)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/linebreaks-missing/#post-8520873)
 * Worked like an absolute charm! Thank you so much [@dhirnitish](https://wordpress.org/support/users/dhirnitish/)
   for saving me a few hours of looking through the code.
 * I do find it hard to believe, given the amount of open tickets about this that
   SendGrid were unable to replicate the issue :/
 * Kieran.
 *  Thread Starter [dhirnitish](https://wordpress.org/support/users/dhirnitish/)
 * (@dhirnitish)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/linebreaks-missing/#post-8520902)
 * I am glad i could help. I just wish they could push this in their coming updates.
 *  Anonymous User 12640152
 * (@anonymized-12640152)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/linebreaks-missing/#post-8523253)
 * Hi,
 * Thank you for suggesting that line, but we can’t have it in our code since that
   will break other emails (html). We will keep investigating the issue and try 
   to come with a fix for you!
 * Thanks,
    SendGrid
 *  Thread Starter [dhirnitish](https://wordpress.org/support/users/dhirnitish/)
 * (@dhirnitish)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/linebreaks-missing/#post-8523284)
 * @team-rs All the emails work fine after adding that line.You can include an on
   off switch for it in the settings page if needed.
 * Thanks
    Nitish
 *  [toddcav](https://wordpress.org/support/users/toddcav/)
 * (@toddcav)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/linebreaks-missing/#post-8698301)
 * I came here to report this exact issue with me as well.
 * [@dhirnitish](https://wordpress.org/support/users/dhirnitish/), are you saying
   you’re able to send HTML emails as well with no issue with your fix? I’m concerned
   by @team-rs’s response about HTML emails.
 * @team-rs, I reported this to your support team and received a pretty lame reply(“
   It’s WordPress..contact them.”). I hope you’re able to resolve this soon. Thanks
   for your help.
 *  Thread Starter [dhirnitish](https://wordpress.org/support/users/dhirnitish/)
 * (@dhirnitish)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/linebreaks-missing/#post-8698675)
 * [@toddcav](https://wordpress.org/support/users/toddcav/) as far as i can remember,
   its still working good for me. You can try it forsure and comment it out if it
   does not do the right job for you.
 * Thanks

Viewing 15 replies - 1 through 15 (of 21 total)

1 [2](https://wordpress.org/support/topic/linebreaks-missing/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/linebreaks-missing/page/2/?output_format=md)

The topic ‘Linebreaks Missing’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/sendgrid-email-delivery-simplified_264460.
   svg)
 * [SendGrid](https://wordpress.org/plugins/sendgrid-email-delivery-simplified/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/sendgrid-email-delivery-simplified/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/sendgrid-email-delivery-simplified/)
 * [Active Topics](https://wordpress.org/support/plugin/sendgrid-email-delivery-simplified/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sendgrid-email-delivery-simplified/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sendgrid-email-delivery-simplified/reviews/)

## Tags

 * [linebreaks](https://wordpress.org/support/topic-tag/linebreaks/)

 * 21 replies
 * 5 participants
 * Last reply from: [andrew55](https://wordpress.org/support/users/andrew55/)
 * Last activity: [8 years, 8 months ago](https://wordpress.org/support/topic/linebreaks-missing/page/2/#post-9343561)
 * Status: not resolved