Viewing 7 replies - 1 through 7 (of 7 total)
  • Michael Beckwith

    (@tw2113)

    The BenchPresser

    I’m hoping this callback linked below, which was added a while back, would help take care of that. It’s been added and removed from the wp_mail_content_type filter a number of times. If it’s not working like it should yet, then I need to look into things again.

    https://github.com/WebDevStudios/BuddyPress-Registration-Options/blob/master/includes/admin.php#L875

    Thread Starter andrewbriggs

    (@andrewbriggs)

    I could not save html markup tags in the Account Approved text box. When I clicked Update or Save, the text box removed the html markup tags.

    Looking into this, sanitize_text_field was removing them:
    https://github.com/WebDevStudios/BuddyPress-Registration-Options/blob/master/includes/admin.php#L94

    After removing that function and not modifying anything else, I was able to get the HTML into the text box and then the email came through with HTML formatting.

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    Aha. Thank you for the spur of reminder.

    https://github.com/WebDevStudios/BuddyPress-Registration-Options/commit/ac900f838c2c2cfe5a45b422bf7e216bcd7c758a

    I did in fact change that a month ago, but it had not be part of a release yet.

    I don’t foresee a release in the immediate future, admittedly, so feel free to change the spots to match what I have in the commit above, and you should be fine once the 4.3.0 update does come out.

    Thread Starter andrewbriggs

    (@andrewbriggs)

    Thx for the fast response.

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    welcome

    Hi guys,

    Sorry to pile on a closed issue… but I ran into this same problem. Just trying to add some basic line breaks to the email messages.

    I altered these lines as suggested by Michael

    //$activate_message = sanitize_text_field( $args['activate_message'] );
    	$activate_message = esc_textarea( $args['activate_message'] );
    	update_option( 'bprwg_activate_message', $activate_message );
    
    	//$approved_message = sanitize_text_field( $args['approved_message'] );
    	$approved_message = esc_textarea( $args['approved_message'] );
    	update_option( 'bprwg_approved_message', $approved_message );
    
    	//$denied_message = sanitize_text_field( $args['denied_message'] );
    	$denied_message = esc_textarea( $args['denied_message'] );
    	update_option( 'bprwg_denied_message', $denied_message );

    Which does allow basic HTML tags, like br, to save in the dashboard as you’d expect.

    However, when the email gets sent… the “br” appears in the text of the email rather than becoming a line break.

    Any ideas?

    I am working on a buddypress site for people with cognitive problems, so I am trying to make everything as clear as possible.

    Thanks

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    Possible that they’re still being sent as plaintext emails and not HTML. I believe I try to change that in the plugin, but it may not be working like first thought.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Formatting Account Approved Email and Other Emails’ is closed to new replies.