Title: HTML vs PlainText
Last modified: August 22, 2016

---

# HTML vs PlainText

 *  [Lab41](https://wordpress.org/support/users/lab41/)
 * (@lab41)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/html-vs-plaintext/)
 * As per a previous thread I have a function to force HTML emails to be used with
   the plugin. Works like a charm, except for some plaintext emails.
 * It strips out the line spaces when a plaintext email is sent. Is there any way
   to only have it strip spaces out of HTML emails?
    This is what my plaintext emails
   look like: [http://screencast.com/t/3BKO9iYm1E](http://screencast.com/t/3BKO9iYm1E)
 * Here is the function:
 *     ```
       add_action( 'init', 'wpbe_wpmandrill_compatibility_init' );
   
       function wpbe_wpmandrill_compatibility_init() {
       	global $wp_better_emails;
   
       	remove_filter( 'mandrill_payload', array($wp_better_emails, 'wpmandrill_compatibility') );
   
       	// do your own email processing
       	add_filter( 'mandrill_payload', 'wpbe_wpmandrill_compatibility' );
       }
   
       function wpbe_wpmandrill_compatibility( $message ) {
   
           global $wp_better_emails;
   
           // make sure you have the %content% tag in the template
           if ( $wp_better_emails->check_template() ) {
               // clean < and > around text links in WP 3.1
               $message['html'] = $wp_better_emails->esc_textlinks( $message['html'] );
               // make links out of URLs
               $message['html'] = make_clickable( $message['html'] );
               // set template
               $message['html'] = $wp_better_emails->set_email_template( $message['html'] );
               // replace variables
               $message['html'] = apply_filters( 'wpbe_html_body', $wp_better_emails->template_vars_replacement( $message['html'] ) );
           }
   
           return $message;
       }
       ```
   
 * Any help is appreciated! Unfortunately, there is no way to make the plugin using
   plaintext send HTML hence I need to find a solution for this if possible.
 * [https://wordpress.org/plugins/wp-better-emails/](https://wordpress.org/plugins/wp-better-emails/)

The topic ‘HTML vs PlainText’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-better-emails_f6f6f6.svg)
 * [WP Better Emails](https://wordpress.org/plugins/wp-better-emails/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-better-emails/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-better-emails/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-better-emails/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-better-emails/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-better-emails/reviews/)

## Tags

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

 * 0 replies
 * 1 participant
 * Last reply from: [Lab41](https://wordpress.org/support/users/lab41/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/html-vs-plaintext/)
 * Status: not resolved