• Resolved hnnhtabunan

    (@hnnhtabunan)


    We are using a custom email template in a custom plugin. All emails sent when WP HTML Mail is activated has 96 in its content.

    I believe this is connected to this topic which is marked resolved before.

    As someone mentioned on that discussion, the characters comes from this tag:

    <o:PixelsPerInch>96</o:PixelsPerInch>

    I have that line of code on the custom email template.

    • This topic was modified 6 months, 4 weeks ago by hnnhtabunan.
    • This topic was modified 6 months, 4 weeks ago by hnnhtabunan. Reason: clarity
Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support Julian

    (@juliangk)

    Hello @hnnhtabunan,

    If you are using WPForms, please turn on the “Hide header “option. You can also deactivate “Use template”.

    Best regards
    Julian

    Thread Starter hnnhtabunan

    (@hnnhtabunan)

    Hello @juliangk, thanks for the quick reply.

    I am not using WPForms but here the plugins I am using that might have affected the email.

    • Contact Form 7
    • WooCommerce

    I’m also using the Divi theme.

    Many thanks,

    Hannah

    Plugin Support Julian

    (@juliangk)

    Hello Hannah,

    you can use the same options for any supported plugins.
    Please describe in detail which e-mail triggers the problem when it is send, how it is triggered and which other plugins you use, that might interfere.

    Thank you and best regards
    Julian

    Plugin Support Julian

    (@juliangk)

    Hello Hannah,

    does your issue still persist?

    Best regards
    Julian

    Thread Starter hnnhtabunan

    (@hnnhtabunan)

    Hi Julian,

    I’m sorry for the late reply. Still having the same issue.

    Where can I find the “Hide header” option?

    The email that triggers the problem is an email template created inside a custom plugin. As mentioned, the email has these lines of code in the email template:

    <!--[if gte mso 9]>

    <xml>

    <o:OfficeDocumentSettings>

    <o:AllowPNG/>

    <o:PixelsPerInch>96</o:PixelsPerInch>

    </o:OfficeDocumentSettings>

    </xml>

    <![endif]-->

    While this is the code for sending the email:

    public function sendThisEmail($token, $product) {
        $currentUserId = get_current_user_id();
        $user          = wp_get_current_user();
        $user_name     = $user->data->display_name;
        $email         = $user->data->user_email;
    
        $logo        = "logo/link";
        $subject     = "This is a subject" ;
        $headers     = array('Content-Type: text/html; charset=UTF-8');
    
        $message = MailHelper::prepareEmail(
            CUSTOM_PLUGIN . '/views/wp-html-mail/email-template',
            array(
                'logo' => $logo,
                'email' => $email,
                'user_name' => $user_name,
            )
        );
        wp_mail( $email, $subject, $message, $headers );
    }
    
    public static function prepareEmail( $template, $params = array() ) 
        {
            if ( !empty( $params ) && is_array( $params ) ) {
                extract( $params );
            }
    
            ob_start();
            require( $template );
            $result = ob_get_contents();
            ob_end_clean();
    
            return $result;
        }

    Many thanks,
    Hannah

    Plugin Support Julian

    (@juliangk)

    Hello Hanna,

    The email that triggers the problem is an email template created inside a custom plugin.”

    What plugin are you using? If the plugin is not supported it will not work, but then you could use this filter, to deactivate our template for these specific emails.

    You can fin the option for disabling header for support plugins under:
    Settings -> Email template > Plugin emails (then click on plugin under Active plugins).

    Best regards
    Julian

    Plugin Support Julian

    (@juliangk)

    Hello Hanna,

    do you still have troubles?

    Best regards
    Julian

    Thread Starter hnnhtabunan

    (@hnnhtabunan)

    Hey Julian,

    Thank you very much! My issue is resolved by adding the filter you suggested. ?? I appreciate your help!

    Many thanks,
    Hannah

    Plugin Support Julian

    (@juliangk)

    I am happy it worked.

    If you experience any further issues, let us know please.

    Best regards
    Julian

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘96 Displaying in the Email’ is closed to new replies.