Line breaks for approval/denial emails?
-
It seems that Admin Pending Email Messages display properly with line breaks, but approval and denial emails are sent as one line. No line breaks.
Is this a known issue/feature/bug? Or am I doing something wrong?
-
Additionally, is there any way of getting email notifications just like the buddypress notifications? Admins of my site would like to receive an email when a new user has applied.
Can you provide screenshots of the versions you’re seeing, so that I can visualize the same?
There should already be notifications via email going out, both from WordPress/BuddyPress core just saying you have a new signup, as well as one from us saying there’s a new person to moderate.
Pending: https://gyazo.com/646563198c485554829535eb5cb4ca55
Denial: https://gyazo.com/19a109946ed1e54c9ee559a617b75a25As for the notifications… huh…
The settings panel for notifications is pretty bare, not sure why it doesn’t produce any emails. https://gyazo.com/80d6b13e62e1739736e708d27ca919e3
Can you copy/paste the approval/denial messages that you have saved, including line breaks and whatnot? Screenshot would be fine too, for what it’s worth.
Regarding notifications, there should have already been emails sent out in general, that’s how the plugin has handled the topic for years.
In terms of the BuddyPress notification system on the frontend and with little bubbles in the toolbar etc, that’s new as of version 4.3.x, and may need refinement or extra feature inclusion.
Regardless, unless you have emails disabled or something isn’t working around emailing, you should be getting messages there for new signups. We utilize the wp_mail() functionality and plan to integrate with BuddyPress Emails in the future. That is probably what you’re seeing in the latter screenshot.
Dear [username],
Your application to the 13th MEU has been reviewed by S1 – Administration & Personnel and has been DENIED. Unfortunately we are not able to give you a reason in this email as it is a generic denial message. Please direct yourself to our Teamspeak if you want more details on why you were denied.
We appreciate your interest in the 13th MEU.
Best Regards,
S1 – Administration and PersonnelDear [username],
Thank you for your application to the 13th MEU. Your account is currently pending approval. You will need to undergo an interview before your application can be approved. Please direct yourself to our Teamspeak no more than 48 HOURS from now, or else your application will be DENIED.
Teamspeak Address: ts.13thmeu.co.uk
Room: Looking for a recruiterBest Regards,
S1 – Administration and PersonnelAs for the email issue, the problem is on our end then. I’ll see what I can find out and keep you informed if I find a solution for it.
Thanks.
Definitely missing some line breaks.
I’m curious if this change would help here: https://github.com/WebDevStudios/BuddyPress-Registration-Options/commit/d1bb9732f6ee34db1849f40b1e6e1e9f7a4f891f
It’s one that I did merge in to our codebase, so it’ll be part of a future release. I would love to see if making the same change for you would fix this issue though.
If you’re comfortable with adding it yourself, have at it. If you’d prefer I make the edit, then I can send over a hotfixed version for you to try.
No unfortunately that fix has broken the pending email line breaks as well. Rightfully so since that line only changes pending email behaviour? I’m not that comfortable with PHP nor wordpress, but I would imagine removing that new filter from the other functions would solve that?
hrmm…okay.
Let me tinker around a bit and see how easily I can recreate and then potentially fix as well.
If you don’t hear back from me by end of week, please nudge me to keep me reminded.
Let’s give this a try.
https://www.dropbox.com/s/55llz4122eij3w7/bp-registration-options.zip?dl=0
I traced my way through how WordPress handles emailing, and found a spot where it was stripping some of the characters that were set/saved with the messages above. So, I searched around for possible solutions, and found someone recommending simply passing things through wpautop() before emailing. So…that’s what I have amended here in the 3 spots where we send messages via wp_mail().
The version number in the zip file above hasn’t been changed at all, but the changes are there, ready to try.
Haha very close;
<p>Dear PageTest, </p>
<p>Thank you for your application to the 13th MEU. Your account is currently pending approval. You will need to undergo an interview before your application can be approved. Please direct yourself to our Teamspeak no more than 48 HOURS from now, or else your application will be DENIED.</p>
<p>Teamspeak Address: ts.13thmeu.co.uk <br />
Room: Looking for a recruiter</p>
<p>Best Regards,<br />
S1 – Administration and Personnel</p>Dear PageTest,
Your application to the 13th MEU has been reviewed by S1 – Administration & Personnel and has been DENIED. Unfortunately we are not able to give you a reason in this email as it is a generic denial message. Please direct yourself to our Teamspeak if you want more details on why you were denied.
We appreciate your interest in the 13th MEU.
Best Regards,
S1 – Administration and PersonnelThere is something inherently different between pending and denial/approve messages. Pending emails with
wpautop()
displays all the HTML tags as well. I revertedbp_registration_options_send_pending_user_email()
back to$args['message']
instead ofwpautop()
and now all emails display the way they should.https://gyazo.com/9b134093c1d859e10de53b77323a40f4
https://gyazo.com/903453e67ecabdfaef440f9e9288c5ba
https://gyazo.com/5788618e07975f27381701472a187485Not sure if the inherent difference between the emails being sent is related to the plugin, but something behind the scenes seems to
wpautop()
the pending emails already. Either way, thanks for the help!Hmm…given the nature of wp_mail, and how much it can be filtered/completely overwritten, this is likely going to be a back and forth topic from my end. What works for one site, may not work for another.
That said, I think I’m going to not completely revert this idea, but instead do our own filter about whether or not to run the messages through wpautop().
if ( apply_filters( 'some_filter', true ) ) { $msg = wpautop( $msg ); }
This way, I could provide a 1-line snippet of code that could toggle that as needed. Chances are at the time, it may break what we have done for your case. Will depend on if I want to have it applied by default or not.
In case anyone is wanting to follow along on GitHub.
https://github.com/WebDevStudios/BuddyPress-Registration-Options/issues/147
Hi there,
I have this problem too. This does not seem to be resolved in the plugin. Could you please update the plugin or just tell us what to do to solve it?Thanks in advance
No presently available for sure working solution. We’d need to do some testing and such before we have any sort of fix ready.
We appreciate the followup and nudging.
- The topic ‘Line breaks for approval/denial emails?’ is closed to new replies.