• Resolved dhauradou

    (@dhauradou)


    Hello,

    I think it is since the merge of email template add on plugin, but the html created via beefree cannot be used in the header and footer html content section of PmP. In the email received, there is now some unwanted characters.

    Some html is now stripped like :

    <!--[if gte mso 9]>
          <xml>
            <o:OfficeDocumentsettings>
              <o:AllowPNG/>
              <o:PixelsPerInch>96</o:PixelsPerInch>
            </o:OfficeDocumentsettings>
          </xml>
        <![endif]-->

    is being transformed to :

    <!--[if gte mso 9]>-->
          <xml>
            
              
              96
            
          </xml>

    This is a classic header html code snippet. I tried the patch : remove_filter(‘wp_mail_content_type’, ‘pmpro_wp_mail_content_type’); but no luck.

    Would you have an idea how to get the html not stripped like before the email content integration ?

    Thank you !

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Andrew Lima

    (@andrewza)

    Hi @dhauradou

    Thank you for reaching out to Paid Memberships Pro.

    With the new release of merging Email Templates into core, we adjusted what strings are considered ‘safe’ and rely on wp_kses (with slight tweaking) to allow certain code in the emails.

    You may filter on ‘pmpro_kses’ and return the original string to bypass this restriction here – https://github.com/strangerstudios/paid-memberships-pro/pull/1770/files#diff-1c08b27bcf43583c75cbc442bc401638be3427586fe544f3389e22c9979fa1afR3721

    We are still working on documenting this new filter, I hope this helps get you started.

    Thread Starter dhauradou

    (@dhauradou)

    Hello @andrewza

    I am sorry but I don’t understand how to “filter on ‘pmpro_kses’ and return the original string”.

    I used one of your gist https://gist.github.com/sc0ttkclark/7297d8e8a41a2ac2309af778364e86da, but it does not work:

    add_filter( 'pmpro_kses', 'my_disable_pmpro_kses_for_email', 10, 3 );
    
    function my_disable_pmpro_kses_for_email( $sanitized_string, $original_string, $context ) {
    	// Only change if context is pmpro_email.
    	if ( 'pmpro_email' !== $context ) {
    		return $sanitized_string;
    	}
    
    	// Just return the original string and do not process it.
    	return $original_string;
    }

    $sanitized_string and $original_string are already stripped.
    Can you help me ?

    Thank you, have a great day !

    • This reply was modified 2 years, 5 months ago by dhauradou.
    Plugin Author Andrew Lima

    (@andrewza)

    Thanks for the feedback, I have tested this code on my end and it works as intended. The XML stays inside the email content, you may need to view the Plain Text version of the email to see the XML code.

    I recommend to get in touch with a local WordPress developer to help you with this further if it’s still not working. I am unable to replicate this issue on my end, once this code has been applied.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Email content is beeing modified’ is closed to new replies.