Support

Home Forums Event Espresso Premium Safe way to edit email_main_default.css

Safe way to edit email_main_default.css

Posted: March 9, 2015 at 1:04 am

Viewing 2 reply threads


Jon Ang

March 9, 2015 at 1:04 am

Hi, I want to change some default css colours. Eg class – callout

I am aware I can set inline styles in the message system, but it does not make sense if I can simply safely override the css file.

Is there a filter I can use?

As far as I see, email_main_default.css is not enqueued.


Dean

March 9, 2015 at 3:15 am

Hi Jon,

Take a look at this filter, you can use it to change the CSS file that the message type uses: http://developer.eventespresso.com/hooks/fhee__ee_messages_template_pack__get_variation/


Jon Ang

March 10, 2015 at 3:49 am

Dear Dean,

That helped greatly.

Posting my code to help others


function wingz_ee_modify_email_css( $variation_path, $messenger, $message_type, $type, $variation, $file_extension, $url, EE_Messages_Template_Pack $template_pack ) {
    if ( $messenger != 'email' ) {
        return $variation_path;
    }

    //for this example we'll just filter the wpeditor for this variation
    if ( $type != 'main' ) {
        return $variation_path;
    }

    $new_url = get_stylesheet_directory_uri() . '/includes/event-espresso/css/wingz_ee_email_main.css';
    return $new_url;
}
add_filter( 'FHEE__EE_Messages_Template_Pack__get_variation', 'wingz_ee_modify_email_css', 10, 8 );

Marking resolved!

Viewing 2 reply threads

The support post ‘Safe way to edit email_main_default.css’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso