Skip to:
Content
Pages
Categories
Search
Top
Bottom

Space characters appear in subscription mail


  • purityboy83
    Participant

    @purityboy83

    Hi

    I am receiving emails about new posts through the subscription feature.

    Space tags are checked in the message content.

    For example, I wrote a post like the image below.
    ===========================
    test

    test

    test
    ===========================

    Image Link : https://ibb.co/nMvRjwQ

    but received mail include to “& nbsp;”
    =================================
    test

    &nbsp ;

    test

    &nbsp ;

    test
    =================================

    Image Link : https://ibb.co/dWcQHVM

    I need help to solve the problem

    Best Regards,
    Hyunho

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

  • itsmifred
    Participant

    @itsmifred

    Hi,
    same problem for me, did you find an issue ?
    regards,
    Fred


    purityboy83
    Participant

    @purityboy83

    Hi @itsmifred

    I’ve installed the “bbPress Notify (No-Spam)” plugin
    I solved it by changing “Email Type” to “plain text” in the plugin settings.

    Thanks


    itsmifred
    Participant

    @itsmifred

    Nice ! I am going to try this…

    Best regards,

    Fred


    itsmifred
    Participant

    @itsmifred

    Hi again,

    need to install on top of it BBPress Bridge (about 9$/month)

    so, I am not going to use it.

    In TEXTE mode it is possible to delete unwanted characters before sending a new subject.
    This is what I do and tell customers to do…

    Thanks anyway

    Fred


    Robin W
    Moderator

    @robin-w

    try

    bbp style pack

    once activated go to

    dashboard>settings>bbp style pack>Subscription Emails

    where you can amend what is sent, or indeed switch to plain text


    itsmifred
    Participant

    @itsmifred

    Hi Robin,

    first of all thank you for this message.
    I already have bbp style pack activated and email format is already TEXT, not HTML…

    Fred


    Robin W
    Moderator

    @robin-w

    ok, so switch to html text


    itsmifred
    Participant

    @itsmifred

    I can try. Option TEXT and/or HTML would be nice…
    I do believe there is still some problems with servers which don’t accept HTML, am I wrong ?

    Fred


    itsmifred
    Participant

    @itsmifred

    TEXT or HTML no difference….

    Fred


    Robin W
    Moderator

    @robin-w

    ok, not sure how to help further, maybe try

    it could be a theme or plugin issue

    Themes

    As a test switch to a default theme such as twentytwenty, and see if this fixes.

    Plugins

    If that doesn’t work, also deactivate all plugins apart from bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.

    If you cannot do this to your site (say because it is live) then use the ‘troubleshooting’ features of this plugin to let you test without affecting other users

    Health Check & Troubleshooting

    Then come back


    itsmifred
    Participant

    @itsmifred

    You’re right, this is what I have to do…

    no need to install new plugin I do have a staging clone…

    Fred


    Robin W
    Moderator

    @robin-w

    and the problem may well be with intervening parts of email system – emails have become very complicated in how they are delivered, and you may find that emails to you have this, but other email users don’t get the problem


    itsmifred
    Participant

    @itsmifred

    You’re right Robin but the thing is :

    a line feed generates html characters set for a space ( ). These unwanted characters are not visible in VISUAL mode, but are visible in TEXTE mode (and can therefore be deleted in TEXT mode, but users don’t necessarily think to do so).

    So, this happen before the email has been send.


    Robin W
    Moderator

    @robin-w

    ok, so this should take them out

    add_filter( 'bbp_subscription_mail_message' , 'rew_strip_nbsp', 40 , 1 );
    add_filter( 'bbp_forum_subscription_mail_message' , 'rew_strip_nbsp', 40 , 1  );
    
    function rew_strip_nbsp ($message) {
    $message = str_replace (' ' , '', $message ) ;
    return ($message) ;
    }

    Put this in your child theme’s function file –

    ie wp-content/themes/%your-theme-name%/functions.php

    where %your-theme-name% is the name of your theme

    or use

    Code Snippets


    itsmifred
    Participant

    @itsmifred

    Hi Robin,

    thanks again but doesn’t make any difference… (I cleared the browser cache after child theme‚Äôs function file update)

    Fred


    Robin W
    Moderator

    @robin-w

    ok, presuming the characters are exactly this

     

    sorry nothing further I can do.

    if different put that in the appropriate line


    itsmifred
    Participant

    @itsmifred

    Yes exactly this `  and to be exact :

    appears when you make 2 line breaks and not just one.
    In other words, when you break a line.

    would this require a different php formulation?

    Anyway, thank you very much…


    Robin W
    Moderator

    @robin-w

    ok, just tried that in my test site and the code above seems to work.

    1. can you give me a exactly what you have put into your functions file, with a few lines above and below

    2. are you using any other bbpress related plugins?

    3. are you using any mail related plugins?


    itsmifred
    Participant

    @itsmifred

    hi Robin,here it is :

    1) function file without you add :

    <?php
    add_action( ‘wp_enqueue_scripts’, ‘theme_enqueue_styles’ );
    function theme_enqueue_styles() {
    wp_enqueue_style( ‘parent-style’, get_template_directory_uri() . ‘/style.css’ );
    }

    add_action( ‘wp_enqueue_scripts’, ‘style_theme_enfant’, 20 );
    function style_theme_enfant() {
    wp_enqueue_style( ‘child-style’, get_stylesheet_uri() );
    }

    function my_custom_member_list_sort( $ret ) {
    $ret[‘type’] = ‘alphabetical’;
    return $ret;
    }
    add_filter( ‘bp_after_has_members_parse_args’, ‘my_custom_member_list_sort’ );

    2)
    bbp Style pack
    bbPress
    BP Profile Search
    BuddyPress
    BuddyPress Xprofile Custom Field Types
    Fix Forum Emails
    GD bbPress Attachments

    3)
    No


    Robin W
    Moderator

    @robin-w

    ok, try this

    add_filter( 'bbp_subscription_mail_message' , 'rew_strip_nbsp', 40 , 1 );
    add_filter( 'bbp_forum_subscription_mail_message' , 'rew_strip_nbsp', 40 , 1  );
    
    function rew_strip_nbsp ($message) {
    	//$message = str_replace ('&nbsp;' , '', $message ) ;
    	$message = 'hello'.$message ;
    return ($message) ;
    }

    This should simply add the word ‘hello’ before the message, which will prove that the filter is firing.


    itsmifred
    Participant

    @itsmifred

    Yes Robin, this is working.

    So : I tried again you first add and it is working fine !

    the html space code is still visible in TEXTE mode but not in the email.

    I am very sorry because of still in the TEXTE mode visible I didn’t even tried first time to send a test subject and make you loosing time !

    thank you for your perseverance and kindness.

    I tried on the staging clone but I am going to use it on the production one. Thanks again.

    Fred


    Robin W
    Moderator

    @robin-w

    great – glad we got there !!


    itsmifred
    Participant

    @itsmifred

    Pretty glad too that… you got it !!!

Viewing 23 replies - 1 through 23 (of 23 total)
  • You must be logged in to reply to this topic.
Skip to toolbar