Encoding problem – danish characters
-
Hi, I have a problem with Danish characters like ?, ? , ?.
They don’t display correctly in html mails – I get strange things like?¥ , ?|r
How can I remedy this?
Thanks,
Lars
-
Hi @adjunkten,
Can you try the following fix?
https://github.com/boonebgorges/buddypress-group-email-subscription/commit/448b3ae7cd98d636361b6da0e8aa25cff4dbb4d9If you can’t patch, replace the
bp-activity-subscription-digest.php
file with this:
https://github.com/boonebgorges/buddypress-group-email-subscription/raw/master/bp-activity-subscription-digest.phpHi Ray,
Thanks.
I used option 2 and replaced the specified file , but the problem remains unsolved in a digest email I received this morning – did you include the patch in the recent update, or should I try to replace the file again?
Cheers,
Lars
@adjunkten – Thanks for testing. It sounds like the problem still exists.
Can you provide a list of steps to duplicate the issue? Are you posting this content into the group activity post form or in the group forums?
Are you using any email plugins? If so, which one(s)? Do your emails use HTML or plain-text? Can you take a screenshot of an email?
-
This reply was modified 7 years, 11 months ago by
r-a-y.
A group member posted an activity update in the group.
I use WP Better Email, which basically wraps the mail with a logo. Should I deactivate and use Buddypress Email instead?
Here is an image of the email:I have highlighted the unwanted characters – they should have been either ‘?’,’?’ or ‘?’
Kind regards,
Lars-
This reply was modified 7 years, 11 months ago by
Lars Henriksen.
Thanks for the feedback.
v3.7.0 was released with BuddyPress native HTML email support in mind, but we should make sure that other email plugins will continue to work as advertised.
I’m not sure how possible it is to do this since plugins like WP Better Emails rely on the plaintext version of the email and the plain-text version of the email is supposed to be encoded like what you see in the screenshot.
Can you try adding the following code snippet to
wp-content/plugins/bp-custom.php
or your theme’sfunctions.php
file?// Remove plain-text conversion for usage with WP Better Emails and plugins like that. add_action( 'bp_ges_before_bp_send_email', function() { remove_filter( 'bp_email_get_property', 'ass_email_convert_html_to_plaintext', 20, 3 ); } );
-
This reply was modified 7 years, 11 months ago by
r-a-y.
Keep in mind that the above code snippet will fix your HTML emails when using a 3rd-party WP email plugin, but the plain-text versions of these emails will use HTML markup…
If you want to fix the plain-text version, you’ll need to use a filter if it is available in your email plugin. If you’re using WP Better Emails, you can use their
'wpbe_plaintext_body'
filter to remove the HTML markup.Probably with the following code snippet:
add_filter( 'wpbe_plaintext_body', 'strip_tags' );
Untested.
Hi @r-a-y, thanks again for helping out.
I will get lost in too many snippets and filters and hacks – better to keep it simple.
I have deactivated WP Better Email and adjusted the Buddypress Email templates to my needs. (Do you know if Buddypress Email templates will survive updates, by the way?)
Cheers,
Lars
-
This reply was modified 7 years, 11 months ago by
Lars Henriksen.
Hi @adjunkten,
BuddyPress HTML email templates uses a template file, much like a theme template file. So if you’ve made customizations to the look of the email template (such as adding a logo), they should survive:
https://codex.buddypress.org/emails/#customize-email-template
The actual email post content template is stored in the database:
https://github.com/boonebgorges/buddypress-group-email-subscription/wiki/Email-Tokens
https://codex.buddypress.org/emails/
Hi again @r-a-y
Here is a little update. I tried your code snippet on my staging site with WP Better Email enabled , and it works – although it looks like the non-responsive email adresses breaks the html layout:
As you can see the center container breaks to the right… but I will use your patch anyway on my live site ?? Thanks!
Would it be possible to have text-links instead of url-adresses
All the best,
Lars
-
This reply was modified 7 years, 10 months ago by
Lars Henriksen.
-
This reply was modified 7 years, 10 months ago by
Lars Henriksen.
-
This reply was modified 7 years, 10 months ago by
Lars Henriksen.
You could try modifying the BuddyPress Emails post content for GES.
Login to the WP admin dashboard and click on the “Emails” icon. Find th email posts for GES:
https://github.com/boonebgorges/buddypress-group-email-subscription/wiki/Email-Tokens
Click on the one that says
"A member created a group activity entry. Used by the Group Email Subscription plugin during immediate sendouts."
in the"Situations"
column. Then edit the"Plain-text email content"
field.The trick here is you would modify the content to use HTML instead of plain-text since we’re forcing the use of HTML with WP Better Emails for plain-text. Use the GES tokens I linked to above to use a text link.
You can try using the following:
{{{ges.action}}}: <blockquote>{{{usermessage}}}</blockquote> – <a href="{{{thread.url}}}">Go to the discussion</a> to reply or catch up on the conversation. {{{ges.email-setting-description}}}
Make the modifications you need to make.
-
This reply was modified 7 years, 10 months ago by
r-a-y. Reason: Updated the snippet
-
This reply was modified 7 years, 11 months ago by
- The topic ‘Encoding problem – danish characters’ is closed to new replies.