• Resolved tomangell

    (@tomangell)


    I’m having one big problem with this otherwise great plugin.

    That is, the content for {post_content} in the email notifications that come through don’t seem to carry over line breaks between paragraphs in my posts. Everything just runs together in one huge block of text.

    Has anyone else experienced this issue, and/or do you know of any potential solutions? I really want to use this plugin, but this display issue makes it not very useful for my purposes at the moment.

    Thanks for any help you can offer!

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter tomangell

    (@tomangell)

    Just following up on this as there has been no response as of yet. Thanks for your time and help!

    Plugin Author Kuba Mikita

    (@kubitomakita)

    Hi Tom, sorry for the late response.

    Are you sending an HTML email or plaintext?

    Thread Starter tomangell

    (@tomangell)

    Thank you for the reply. I tried both kinds of emails in the setting: HTML and plain text, and the result is the same — no line breaks whatsoever. Just a big wall of text in the notifications. Any ideas?

    Plugin Author Kuba Mikita

    (@kubitomakita)

    Hmm, the content runs through “the_content” filter: https://github.com/BracketSpace/Notification/blob/develop/class/Defaults/MergeTag/Post/PostContent.php#L49 so it should have the line breaks.

    Can you see them in the email source? Maybe it’s the way you email client is rendering it.

    Thread Starter tomangell

    (@tomangell)

    Looking at the email source, line breaks are only appearing between the different types of content: {post_permalink}, {post_title}, {post_content} but not within the latter ({post_content}).

    See pasted excerpt below:

    <p>https://www.marijuanamoment.net/poll-huge-majority-of-wisconsin-voters-w=
    ant-marijuana-legalized/</p>=0A<p>Poll: Huge Majority Of Wisconsin Voters W=
    ant Marijuana Legalized</p>=0A<p>A steadily growing majority of voters in W=
    isconsin say they want marijuana to be =E2=80=9Cfully legalized and regulat=
    ed like alcohol,=E2=80=9D according to a new poll. Wisconsin is lagging beh=
    ind other states in the Great Lakes and Midwest regions in advancing mariju=
    ana policy reform. Unlike nearby Illinois and Minnesota, the state does not=
    have medical cannabis beyond an extremely limited CBD program. And even si=
    mple possession of marijuana is punishable by six months in jail and a $1,0=
    00 fine. This lack of progress isn=E2=80=99t because voters are unwilling. =
    Sixty-one percent of voters said they want marijuana prohibition to be repl=
    aced with legal regulations, according to a new poll Marquette University L=
    aw School released on Wednesday, compared to 36 percent who said they were =
    opposed.

    Plugin Author Kuba Mikita

    (@kubitomakita)

    Ah, I see.

    So the email client is rendering the paragraphs as a block of text.

    You could hook into this the_content filter and do str_replace( '</p>', '</p><br>', $content )

    Plugin Author Kuba Mikita

    (@kubitomakita)

    Also, I just noticed that =0A is a quite weird way to encode the newline character. So maybe this is causing the issue, but I’m seeing it the first time.

    Thread Starter tomangell

    (@tomangell)

    I’m asking a friend to look at your most recent replies, because I’m not quite savvy enough to parse them. But for what it’s worth the result is the same in Thunderbird desktop app, Gmail in a web browser and iPhone Mail app. I don’t think the issue is related to email clients. They all render post body as a huge wall of text with no line breaks.

    Thread Starter tomangell

    (@tomangell)

    FYI I had a tech savvy friend look at this and he was able to get it fixed. Here’s what he said // how he did it:

    “It’s fixed. This was it: https://www.ads-software.com/support/topic/post_content-in-notification-always-plain-text-want-html/

    “Somehow it’s stripping all the content down to plain text. For whatever reason the {post_content} is coming up as plain text. His theme code is too high-level for me to 100% understand but I can’t tell why it’s happening. So I added the Code Snippets plugin so we don’t have to modify your functions.php file to add your custom code and we don’t have to write a custom plugin either.

    “So what you want to use in all your notifications is {post_content_html}

    “There must be a bug in his code somewhere OR he should just include this in the main plugin.”

    Hopefully that amounts to helpful feedback for you, Kuba, as you work on future updates, and maybe it can help others in the meantime who are experiencing a similar issue.

    Plugin Author Kuba Mikita

    (@kubitomakita)

    Ahhh, I completely forgot about the sanitization… probably it will be a good idea to add this merge tag to the core plugin.

    Will do that

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘No line breaks in notification text’ is closed to new replies.