| 1 |
<?php |
| 2 |
|
| 3 |
namespace YayMail\Utils; |
| 4 |
|
| 5 |
use YayMail\Utils\SingletonTrait; |
| 6 |
|
| 7 |
/** |
| 8 |
* StyleInline utility class |
| 9 |
* |
| 10 |
* Extends WC_Email to use style_inline function |
| 11 |
* |
| 12 |
* @method static StyleInline get_instance() |
| 13 |
*/ |
| 14 |
class StyleInline extends \WC_Email { |
| 15 |
|
| 16 |
use SingletonTrait; |
| 17 |
|
| 18 |
/** |
| 19 |
* Convert CSS to inline styles for email |
| 20 |
* |
| 21 |
* @param string $content HTML content to process |
| 22 |
* @return string HTML content with inline styles |
| 23 |
*/ |
| 24 |
public function convert_style_inline( $content ) { |
| 25 |
if ( empty( $content ) || ! is_string( $content ) ) { |
| 26 |
return $content; |
| 27 |
} |
| 28 |
|
| 29 |
return $this->style_inline( $content ); |
| 30 |
} |
| 31 |
} |
| 32 |
|