Support » Plugin: Email Templates » Do not use in woocommerce

  • Resolved Lage

    (@lage)


    Greetings, I would like your plugin not to interfere with Woocommerce emails. It’s possible?

Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Author Damian

    (@timersys)

    You could add the following on functions.php

    
    if( class_exists('Mailtpl') ) {
        $mailtpl = Mailtpl::instance();
        remove_action( 'woocommerce_email', array( $mailtpl->admin, 'woocommerce_integration'));
         remove_action( 'woocommerce_email_settings', array( $mailtpl->admin, 'woocommerce_preview_link'));
    }

    That doesn’t help it. Woo mails has its own header/footer + header/footer from your plugin ‘around’ it, even with that code in functions.php

    Plugin Author Damian

    (@timersys)

    Please try the following. Just tested and it’s working

    if( class_exists('Mailtpl') ) {
        add_action('init',function(){
            $mailtpl = Mailtpl::instance();
            remove_action( 'woocommerce_email', array( $mailtpl->admin, 'woocommerce_integration'));
            remove_action( 'woocommerce_email_settings', array( $mailtpl->admin, 'woocommerce_preview_link'));
        });
        add_filter('woocommerce_mail_content',function($content){
    
            $mailtpl = Mailtpl::instance();
    
            remove_action( 'phpmailer_init', array( $mailtpl->mailer, 'send_email',50));
    
            return $content;
        });
    }
    

    excellent! 🙂 That works (still need test again on normal wp registration mail after weekend, but surely that’ll be still ok)

    Million thanks!!

    Hi.
    I’m using your great plugin with woocommerce + custom templates plugin (based on faq section). After adding code from above, woocommerce mails now sending with my mail template, but it have some annoying behavior. Plugin gets woocommerce mail template fully includig html/header/body:

    <div id="mailtpl_body">
    <p>
    <!DOCTYPE html><br />
    <html dir="ltr"><br />
    <head><br />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><br />
    <title></title><br />
    </head><br />
    <body leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" offset="0"></p>
    <div id="wrapper" dir="ltr" style="background-color: #ffffff; margin: 0; padding: 70px 0 70px 0; -webkit-text-size-adjust: none !important; width: 100%;">

    This lines (2 and next) adds to sent mail very big vertical space. Is it possible to strip this from woocommerce mails? What should I add to functions.php? Thanks in advance!

    • This reply was modified 2 years, 7 months ago by mrfr0st. Reason: forgot about code tag not showing html markup :p

    Well I partially fixed this problem. I’d copied mail header & footer template parts from woocommerce/templates/emails to my theme/woocommerce/emails & just deleted there starting part (html -> body -> div#wrapper). This helped a lot, but there are little vertical space left. I’ve searched the mail source & found that now it adds this before mail content:

    <p><!DOCTYPE html><br />
    <html><br />
    <head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><br />
    <body></p>

    And this after:

    <p></body><br />
    </html></p>

    This is not a valid html, so I suppose that some mail programs may draw this wrong. Also I’m not sure on wich moment this code is added to mail.

    Hello, thank you for your module.
    I also use it with Woocommerce.

    The problem I encounter is that I lose the H1 title of Woocommerce emails. It is replaced by the name of the blog.
    How can I recover the original title of the email?

    Otherwise, would it be possible to implement a feature that will enable sending all emails or only those unsupported by woocommerce?

    Thank you in advance.

    Have an issue with woocommerce email templates and your plugin still. I have tried to use the snippets above in my site and still I get the same problem. The woocommerce emails are wrapped in the email templates format. So all the alignment and formatting is completely out of alignment and looks awful. Is there anything else I can try? Just want email temples to be used for most everything non related to woocommerce. Also, I am using in addition the pretty emails template for woocommerce which creates a modified tempalet for most woocommerce email functions. If you need images or sample emails where this happens I can surely provide it.
    Please review and advise.

    Thanks.

    Hello when I add the code to the function.php that you provided, my woocommerce email templates show, but they are placed inside your plugins templates? please watch the video in the link to see https://cl.ly/0M0l0c3M1M46

    Also, an annoying site header “find exclusive streetwear brands…” is being attached to the subject bar of the email. How can I remove this??

    https://cl.ly/0S1h25262l29

    • This reply was modified 1 year, 9 months ago by James Huff.
    • This reply was modified 1 year, 9 months ago by drapedup.

    Hi,
    I agree with @drapedup. The problem with Woocommerce is left.

    Plugin Support gonzalesc

    (@gonzalesc)

    Hi, it’s a pleasure.

    The plugin already has the codes embedded to be compatible with Woocommerce and it is not necessary to add theme in functions.php.

    What is the problem really here?

    Hello. Thank you for your work. The plugin is tested with code and without code. With the code in the mail program (for example, The Bat), there are no visual problems. Without the code they are. But if the letter is opened in the browser, the problem remains. In the mail program on Android (AguaMail) the problem is always present. In web versions of mail servers, the problem is always present. Thank’s. (https://ibb.co/cygqbd)

    Plugin Support gonzalesc

    (@gonzalesc)

    Hi
    Ok I dont have the app AguaMail but I can install the bat.

    In a Webmail:
    https://imgur.com/a/D2oPFn3 (good)

    In GMAIL
    https://imgur.com/a/g7tpfvO (good)

    In the Bat
    https://imgur.com/a/N9aYvd8

    The Bat looks like remove all format CSS, but in no case does the header duplicate

    PD: I tested without code in the functions.php

    Regards

    Hi. Yes, you are right, The Bat does not show the Logo. But if you open the HTML version of the letter, it’s through the browser, then there’s a Logo. Apparently, therefore, some services and programs show the Logo twice.

    https://ibb.co/k7w32J
    https://ibb.co/cv3cUy

    Now I have the code added to the function.php

    Regards.

    Plugin Support gonzalesc

    (@gonzalesc)

    Hi.
    I opened the HTML in the Bat:
    https://imgur.com/a/mjMsHlf

    The header is not duplicate. I’m not using the code in the functions.php
    Please try it without the code.

    Regards

    • This reply was modified 1 year, 5 months ago by gonzalesc.
Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Do not use in woocommerce’ is closed to new replies.