Space characters appear in subscription mail
-
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.
===========================
testtest
test
===========================Image Link : https://ibb.co/nMvRjwQ
but received mail include to “& nbsp;”
=================================
test  ;
test
  ;
test
=================================Image Link : https://ibb.co/dWcQHVM
I need help to solve the problem
Best Regards,
Hyunho
-
Hi,
same problem for me, did you find an issue ?
regards,
FredHi @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
Nice ! I am going to try this…
Best regards,
Fred
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
try
once activated go to
dashboard>settings>bbp style pack>Subscription Emails
where you can amend what is sent, or indeed switch to plain text
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
ok, so switch to html text
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
TEXT or HTML no difference….
Fred
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
Then come back
You’re right, this is what I have to do…
no need to install new plugin I do have a staging clone…
Fred
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
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.
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
Hi Robin,
thanks again but doesn’t make any difference… (I cleared the browser cache after child theme’s function file update)
Fred
ok, presuming the characters are exactly this
sorry nothing further I can do.
if different put that in the appropriate line
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…
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?
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 Attachments3)
Nook, 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 (' ' , '', $message ) ; $message = 'hello'.$message ; return ($message) ; }
This should simply add the word ‘hello’ before the message, which will prove that the filter is firing.
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
great – glad we got there !!
Pretty glad too that… you got it !!!
- You must be logged in to reply to this topic.