montero4 Posted June 2, 2020 Share Posted June 2, 2020 Hello, I’m using mautic, a marketing automation platform to send out my newsletters (so I can do tracking etc). Its newsletter builder is quite a pain to use so I figured what I want to do is create the newsletter in PW and simply paste the html code into mautic. One thing it requires is that all css styling is inline (which I can figure out), but one thing it also requires is that <p> tags are actually <br> Tags. I’ve searched through the module library to see if there is a textformatter for this? Anything that jumps to mind? Thank you for your help. Regards, Link to comment Share on other sites More sharing options...
bernhard Posted June 3, 2020 Share Posted June 3, 2020 // not tested class TextformatterP2BR extends Textformatter { public static function getModuleInfo() { return [ 'title' => 'P2BR', 'version' => '1.0.0', 'summary' => 'Textformatter that strips all <p> and replaces </p> by <br>', ]; } public function format(&$str) { $str = str_replace("<p>", "", $str); $str = str_replace("</p>", "<br>", $str); } } 2 1 Link to comment Share on other sites More sharing options...
Robin S Posted June 3, 2020 Share Posted June 3, 2020 You can also configure your CKEditor field to insert <br> tags instead of <p> tags on Enter. https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR.html#property-ENTER_BR 2 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now