• Resolved j0aoj0aquim

    (@j0aoj0aquim)


    Is there a better way for me to allow the use of bold tags <b> and <strong> in the newsletter body headlines? The only way I got it working is by editing the PostTransformerContentsExtractor.php file like this:

    $allowedTitleHtml = [
    ‘a’ => [
    ‘href’ => [],
    ],
    ‘li’ => $commonAttributes,
    ‘h1’ => $commonAttributes,
    ‘h2’ => $commonAttributes,
    ‘h3’ => $commonAttributes,
    ‘strong’ => array(),
    ‘b’ => array(),

    ];

    But this means messing with the plugin files and breaks the plugin automatic update flow. Is there an option in the UI to address this that I’m missing? Or, in alternative, a way to do this code override without messing with the plugin files?

    Thanks.

    • This topic was modified 2 years, 4 months ago by j0aoj0aquim.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Hey there!

    Is there a better way for me to allow the use of bold tags <b> and <strong> in the newsletter body headlines? The only way I got it working is by editing the PostTransformerContentsExtractor.php file like this:

    I understand that you want to add certain HTML tags like bold and strong to the headings you create in the content body of your email newsletters, is that correct?

    You should be able to add these custom HTML tags manually by editing the source code for the created content block in your email. Screenshots below for reference:

    I hope this helps! Feel free to share any additional information if you’re still having trouble with your concerns. We’re always happy to help! 🙂

    Thread Starter j0aoj0aquim

    (@j0aoj0aquim)

    Thanks for the reply, @thomasvu.

    I’m my case, I need to do this in an articles block. That’s why I can’t edit the headlines directly like you suggested. I’m using the articles block to pick the latest 10 articles and send that as an email digest to my newsletter subscribers. Each post title already has the <b> tag applied to it. I just needed Mailpoet to keep them instead of stripping those HTML tags.

    Here’s screenshots for reference:
    https://i.imgur.com/u8OtTCr.png
    https://i.imgur.com/NqLjcik.jpg
    (currently it’s displaying the bold because I edited the PostTransformerContentsExtractor.php file)

    Any way of achieving this without messing with Mailpoet’s plugin files?

    • This reply was modified 2 years, 3 months ago by j0aoj0aquim.
    Plugin Support Lynn J.a11n

    (@lynnjat7)

    Hi there @j0aoj0aquim,

    I do see what you would like to do here, but it’s true that when including titles of blog. posts / articles in our emails we strip any HTML tags out of the titles. This ensures they render properly in both our layouts and in your customer’s inboxes.

    There isn’t an option right now to allow HTML tags in article titles to actually render, instead of being stripped out, but we do have an open issue on our development team requesting this change. It is currently in the triage stage as they determine how best to resolve this issue so there is no fixed ETA on the change at this time.

    Thread Starter j0aoj0aquim

    (@j0aoj0aquim)

    Thanks for the reply, @lynnjat7.

    Glad to hear there’s an open issue in the dev team to address this eventually.

    It would be great to have some control over this in Mailpoet’s settings.
    Even if it’s just some checkboxes or dropdown with some safe HTML tags we could pick to the add to the HTML stripping exclusions or even a simple input to type in the tags exclusions separated by commas.

    Plugin Support Lynn J.a11n

    (@lynnjat7)

    Hi again @j0aoj0aquim,

    Thanks for adding that detail about the ideal way this would work.

    I’ve added some notes to our internal tracking post on this subject, but if you have a chance, would you also be able to add your thoughts and ideas to our MailPoet ideas board? It’s here:
    https://feedback.mailpoet.com/feature-requests

    I searched and didn’t see any customer-generated requests here for HTML rendering of tags in post titles, but I think it might be useful for other customers. Posting here allows other customers to “upvote” your idea which does affect the development team’s priorities, and also will allow you to collect and track all your thoughts on how it should work in a more permanent place that our dev team can find.

    Thread Starter j0aoj0aquim

    (@j0aoj0aquim)

    Hi @lynnjat7

    Thanks for the suggestion. I’ve placed a feature suggestion in there.
    Let’s see if it gets some user traction behind it 🙂

    Plugin Support Lynn J.a11n

    (@lynnjat7)

    Hi @j0aoj0aquim,

    Thanks for taking that step, I also hope it sees some traction!

    I’ll go ahead and mark this thread as solved for now, but please do continue to watch the release notes for upcoming MailPoet versions for any progress or changes on this issue.

    In the meantime, happy mailing!

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘allowedTitleHtml to allow bold and strong’ is closed to new replies.