alexmustin / woocustomemails

Repo for the WC Custom Emails Per Product plugin
https://wordpress.org/plugins/woo-custom-emails-per-product/
GNU General Public License v2.0
21 stars 5 forks source link

Wrap WCO content with custom CSS class for global styling #38

Open christophberinger opened 1 year ago

christophberinger commented 1 year ago

Hey Alex,

great plugin, thank you!

One thing we would love to see is a wrapping container around the WCO content, so we could style that globally in our emails.

Example in the class-woo-custom-emails-output.php:

Instead of this:

// Extra line breaks at the beginning to separate Message content from Email content.
$output .= '<br><br>';

// Output the_content of the saved WCE Message ID.
$output .= nl2br( get_post_field( 'post_content', $wcemessage_id_onhold ) ); 

// Extra line breaks at the end to separate Message content from Email content.
$output .= '<br><br>';

// Output everything!
echo $output;  

Something like this:

// Extra line breaks at the beginning to separate Message content from Email content.
$output .= '<div class="custom-woo-email-content"><br><br>';

// Output the_content of the saved WCE Message ID.
$output .= nl2br( get_post_field( 'post_content', $wcemessage_id_onhold ) );

// Extra line breaks at the end to separate Message content from Email content.
$output .= '<br><br></div>';

// Output everything!
echo $output;

Let me know what you think.

Cheers,

Christoph