Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: forwarded newsletter css #880

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions includes/email-template.mjml.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,24 @@

<mjml>
<mj-head>
<mj-title><?php echo $title; ?></mj-title>
<mj-style>
<?php
$default_css = file_get_contents( dirname( __FILE__ ) . '/email-template-mjml.css' );
$css = $default_css . "\n" . $custom_css;

echo esc_html( $css );
echo Newspack_Newsletters_Editor::get_color_palette_css();
do_action( 'newspack_newsletters_editor_mjml_head' );
?>
<?php if ( isset( $title ) && ! empty( $title ) ) : ?>
<mj-title><?php echo $title; ?></mj-title>
<?php endif; ?>
<mj-style inline="inline">
<?php echo esc_html( file_get_contents( dirname( __FILE__ ) . '/email-template-mjml.css' ) ); ?>
</mj-style>
<?php if ( isset( $custom_css ) && ! empty ( $custom_css ) ) : ?>
<mj-style inline="inline">
<?php echo esc_html( $custom_css ); ?>
</mj-style>
<?php endif; ?>
<mj-style inline="inline">
<?php echo esc_html( Newspack_Newsletters_Editor::get_color_palette_css() ); ?>
</mj-style>
<?php if ( isset( $preview_text ) ): ?>
<mj-preview><?php echo $preview_text; ?></mj-preview>
<?php endif; ?>
<?php do_action( 'newspack_newsletters_editor_mjml_head' ); ?>
</mj-head>
<mj-body background-color="<?php echo $background_color; ?>">
<?php echo $body; ?>
Expand Down