• Resolved neilgee

    (@neilgee)


    Hi,

    I am trying to add a logo to the Approval Email but the in the email the src attribute is being escaped and therefore not displaying.

    I have added the img tag and src to the $allowedtag so it saves in the
    Account Approved Email field which I can see.

    But in the email itself which is delivered in text/html the image is missing as the src attribute is escaped.

    Is there anything else in the plugin code I can adjust.

    • This topic was modified 9 years, 5 months ago by neilgee.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Michael Beckwith

    (@tw2113)

    The BenchPresser

    I’m assuming this is affecting the values being saved in the admin UI for the messages.

    I believe it’s going to revolve around these two commits that were made and slated for version 4.3.0, but are not out yet.

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

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

    So, if you’re willing to edit by hand, you should be able to get these specific changes made until 4.3.0 gets released. I have no plans for a 4.2.13 at the present time.

    From: $activate_message = esc_textarea( $args['activate_message'] );
    To: $activate_message = wp_kses( $args['activate_message'], wp_kses_allowed_html( 'post' ) );

    From: $approved_message = esc_textarea( $args['approved_message'] );
    To: $approved_message = wp_kses( $args['approved_message'], wp_kses_allowed_html( 'post' ) );

    From: $denied_message = esc_textarea( $args['denied_message'] );
    To: $denied_message = wp_kses( $args['denied_message'], wp_kses_allowed_html( 'post' ) );

    Hopefully these changes resolve the issues you’re seeing.

    Thread Starter neilgee

    (@neilgee)

    Thanks for reply Michael – I tried the edits and also the 4.3.0 version but still the img gets escaped – when I check the raw source on the email sent it’s like <img src=\"http://pathtoimage.gif\" />

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    Hmm, not sure at that point. Possible it’s getting escaped sometime between ourselves, and the actual sending attempt.

    I know at least with mailcatcher, I got `<img src=3D”http://buddypress.dev/wp-content/uploads/2016/11/0f70c1133e=
    0424b92edcf214cbe374cc.jpg” alt=3D”” />` showing up, with the “3D” parts right after the =’s, but it still showed the image as a whole in the window and HTML view. Admittedly haven’t tried yet with a site that would be able to externally email.

    Thread Starter neilgee

    (@neilgee)

    Hi Michael – this is actually working for me now – must have been cached before – but now with the edits in place you suggested on the current public version, the logo is now displaying.

    As well as adding img to the allowed tags…

    	add_action( 'init', function () {
    		global $allowedtags;
    	
    			$allowedtags['img'] = array(
    			        'src'  => array (),
    			        'width' => array (),
    			        'height' => array ()
    			);
    		}
    	);
    • This reply was modified 9 years, 5 months ago by neilgee.
    Michael Beckwith

    (@tw2113)

    The BenchPresser

    Sweet. Glad the changes worked eventually, even if delayed.

    Thanks for the followup feedback as well. It’s appreciated.

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

The topic ‘Adding a Logo to the Approval Email’ is closed to new replies.