{"id":1132084,"date":"2016-06-26T07:28:22","date_gmt":"2016-06-26T14:28:22","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/calendar-plugin-breaks-wordpress-emails-by-forcing-contenttype-texthtml\/"},"modified":"2016-06-26T07:28:22","modified_gmt":"2016-06-26T14:28:22","slug":"calendar-plugin-breaks-wordpress-emails-by-forcing-contenttype-texthtml","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/calendar-plugin-breaks-wordpress-emails-by-forcing-contenttype-texthtml\/","title":{"rendered":"Calendar plugin breaks wordpress emails by forcing contenttype text\/html"},"content":{"rendered":"<p>Hi<br \/>\nSince installing your events calendar and pro I noticed that ALL emails sent out by wordpress lost their formatting eg (wordfence logins, wordfence warnings) and the WP password reset emails have lost all line breaks and the password reset url\/link is not included as it forces &lt;&gt; either end which gmail hides.<\/p>\n<p>I&#8217;ve been investigating and found the issue in your plugin file:<\/p>\n<p>\/wp-content\/plugins\/the-events-calendar\/vendor\/tickets\/src\/Tribe\/Tickets_Handler.php<\/p>\n<p>You are adding a filer to wp_mail_content_type but you are not removing that filer after sending the email!<\/p>\n<p>All other plugins Ive scanned eg Wordfence and Broken link checker both have the add_filter and then after their code executes they have the remove-filter to set it back to plain text emails.<\/p>\n<p>LINE 450<\/p>\n<p>add_filter( &#8216;wp_mail_content_type&#8217;, array( $this, &#8216;set_contenttype&#8217; ) );<br \/>\n\t\tif ( ! wp_mail( $email, sprintf( esc_html__( &#8216;Attendee List for: %s&#8217;, &#8216;event-tickets&#8217; ), $event-&gt;post_title ), $content ) ) {<br \/>\n\t\t\t$error-&gt;add( &#8217;email-error&#8217;, esc_html__( &#8216;Error when sending the email&#8217;, &#8216;event-tickets&#8217; ), array( &#8216;type&#8217; =&gt; &#8216;general&#8217; ) );<\/p>\n<p>\t\t\treturn $error;<br \/>\n\t\t}<\/p>\n<p>\t\treturn esc_html__( &#8216;Email sent successfully!&#8217;, &#8216;event-tickets&#8217; );<br \/>\n\t}<\/p>\n<p>\t\/**<br \/>\n\t * Sets the content type for the attendees to email functionality.<br \/>\n\t * Allows for sending an HTML email.<br \/>\n\t *<br \/>\n\t * @param $content_type<br \/>\n\t *<br \/>\n\t * @return string<br \/>\n\t *\/<br \/>\n\tpublic function set_contenttype( $content_type ) {<br \/>\n\t\treturn &#8216;text\/html&#8217;;<br \/>\n\t}<\/p>\n","protected":false},"template":"","class_list":["post-1132084","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Calendar plugin breaks wordpress emails by forcing contenttype text\/html -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/calendar-plugin-breaks-wordpress-emails-by-forcing-contenttype-texthtml\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Calendar plugin breaks wordpress emails by forcing contenttype text\/html -\" \/>\n<meta property=\"og:description\" content=\"Hi Since installing your events calendar and pro I noticed that ALL emails sent out by wordpress lost their formatting eg (wordfence logins, wordfence warnings) and the WP password reset emails have lost all line breaks and the password reset url\/link is not included as it forces &lt;&gt; either end which gmail hides. I&#8217;ve been [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/calendar-plugin-breaks-wordpress-emails-by-forcing-contenttype-texthtml\/\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/calendar-plugin-breaks-wordpress-emails-by-forcing-contenttype-texthtml\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/calendar-plugin-breaks-wordpress-emails-by-forcing-contenttype-texthtml\/\",\"name\":\"Calendar plugin breaks wordpress emails by forcing contenttype text\/html -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2016-06-26T14:28:22+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/calendar-plugin-breaks-wordpress-emails-by-forcing-contenttype-texthtml\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/calendar-plugin-breaks-wordpress-emails-by-forcing-contenttype-texthtml\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/calendar-plugin-breaks-wordpress-emails-by-forcing-contenttype-texthtml\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Calendar Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Events Calendar PRO\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Calendar plugin breaks wordpress emails by forcing contenttype text\/html\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Calendar plugin breaks wordpress emails by forcing contenttype text\/html -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/calendar-plugin-breaks-wordpress-emails-by-forcing-contenttype-texthtml\/","og_locale":"en_US","og_type":"article","og_title":"Calendar plugin breaks wordpress emails by forcing contenttype text\/html -","og_description":"Hi Since installing your events calendar and pro I noticed that ALL emails sent out by wordpress lost their formatting eg (wordfence logins, wordfence warnings) and the WP password reset emails have lost all line breaks and the password reset url\/link is not included as it forces &lt;&gt; either end which gmail hides. I&#8217;ve been [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/calendar-plugin-breaks-wordpress-emails-by-forcing-contenttype-texthtml\/","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/calendar-plugin-breaks-wordpress-emails-by-forcing-contenttype-texthtml\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/calendar-plugin-breaks-wordpress-emails-by-forcing-contenttype-texthtml\/","name":"Calendar plugin breaks wordpress emails by forcing contenttype text\/html -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2016-06-26T14:28:22+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/calendar-plugin-breaks-wordpress-emails-by-forcing-contenttype-texthtml\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/calendar-plugin-breaks-wordpress-emails-by-forcing-contenttype-texthtml\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/calendar-plugin-breaks-wordpress-emails-by-forcing-contenttype-texthtml\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Calendar Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/"},{"@type":"ListItem","position":4,"name":"Events Calendar PRO","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/"},{"@type":"ListItem","position":5,"name":"Calendar plugin breaks wordpress emails by forcing contenttype text\/html"}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1132084","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1132084\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1132084"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}