Support

Home Forums Event Espresso Premium EE4 – Custom css email

EE4 – Custom css email

Posted: April 9, 2017 at 6:17 am


JacquesMivi

April 9, 2017 at 6:17 am

Hello,

I follow the different post but without sucess until now. Maybe something has changed on EE4 ? I have the version 4.9.36

/** CSS Email
// https://eventespresso.com/topic/custom-styles-to-email-message-and-invoice/
————————————————————————-*/

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

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

	$new_url = get_stylesheet_directory_uri() . '/css/email_main_default_new.css';
	return $new_url;
}
add_filter( 'FHEE__EE_Messages_Template_Pack__get_variation', 'ee_modify_html_variation', 10, 8 );

Then I have copied the file email_main_default_new.css on my theme “/wp-content/themes/altitude-pro/css”

Thanks for your help


JacquesMivi

April 9, 2017 at 6:18 am

Then I try some modifications on this CSS but nothing appears


Josh

  • Support Staff

April 10, 2017 at 10:05 am

The conditionals in your code there are telling PHP to return if it’s not an html message type (i.e. an invoice, receipt, or html ticket) and to also return if it’s not the editor page. So in order to load the CSS for an email, you can alter the conditionals so they return if it’s an html message type and if the request is from the editor page.


JacquesMivi

April 11, 2017 at 9:06 am

Perfect. Thanks.

The support post ‘EE4 – Custom css email’ 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.

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: closed

Updated by  JacquesMivi 2 years, 7 months ago ago

Topic Tags

Tagged: , , ,

Notifications

This topic is: resolved
Do NOT follow this link or you will be banned from the site!
[for="input_96_5_3"]
[for="input_96_5_3"]
[gravityform id=96 title=false description=false]
  • This field is for validation purposes and should be left unchanged.
[i]
[i]
[gravityform id=69 title=false description=false]
  • This field is for validation purposes and should be left unchanged.