Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Created October 18, 2017 08:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pebblo/6376cad2620d74cd40b826749eec2aa0 to your computer and use it in GitHub Desktop.
Save Pebblo/6376cad2620d74cd40b826749eec2aa0 to your computer and use it in GitHub Desktop.
An example of how to include some additional styles within the email messenger content.
<?php //Please do not include the opening PHP tag if you already have one
function tw_email_messenger_custom_styles( $message_type, $subject, $from, $main_body ) {
//Close the PHP tag so you don't need to echo the styles.
?>
<style type="text/css" media="screen">
@media only screen and (max-width :480px) {
body {
/*Custom CSS*/
}
}
</style>
<?php
//Reopen the PHP to complete the hook.
}
add_action('AHEE__EE_Email_Messenger_main_wrapper_template_head', 'tw_email_messenger_custom_styles', 10, 4);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment