Custom CSS / Styling

Tagged: 

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #128272
    Thore Janke
    Participant

    Hey there,

    I am trying to apply custom styling to my custom email,
    but it always uses the settings from admin.php?page=wc-settings&tab=email
    and I can not enter <style> tags into the Email content…

    How can I override those colors?

    Or can I use a filter / hook to add custom styling to my email? E.g. with the action woocommerce_email_styles?

    Best regards,
    TJ.

    #128395
    blankMoshtafizur
    Moderator
    Plugin Support

    Hi there,

    I am really sorry to know you are experiencing problems.

    I have escalated this with our development team. They will get back to you as soon as they can.

    Kind regards,
    Moshtafziur

    #131217
    blankTom Anbinder
    Moderator
    Plugin Support

    Hi, Thore,

    Sorry for not getting back to you sooner.

    How can I override those colors?

    Since the plugin v2.7.1, you can set additional styling with the new “Email style” options (in “WooCommerce > Settings > Emails > Custom email #X > Email Data”).

    Or can I use a filter / hook to add custom styling to my email?

    Yes, you can use the alg_wc_custom_emails_content filter:

    add_filter( 'alg_wc_custom_emails_content', function ( $content, $email, $order, $user, $product ) {
        if ( 1 == $email->alg_wc_ce_id ) { // for the "Custom email #1"
            $content = '<style> .my-class { color: orange; } </style>' . $content;
        }
        return $content;
    }, 10, 5 );

    Please give it a try and let me know what you think.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.