From 21fa5df12ed85d3df9e17ff4eb7a1971fc7dfec3 Mon Sep 17 00:00:00 2001 From: Thomas Date: Wed, 26 Jul 2023 18:03:13 +0200 Subject: [PATCH] use v7 --- composer.json | 2 +- src/EmailUtils.php | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index ced86cd..e25826a 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "silverstripe/vendor-plugin": "^2", "silverstripe/framework": "^5", "symbiote/silverstripe-gridfieldextensions": "^4", - "pelago/emogrifier": "^6|^7", + "pelago/emogrifier": "^7", "composer/ca-bundle": "*" }, "require-dev": { diff --git a/src/EmailUtils.php b/src/EmailUtils.php index 1d35b41..fe0ff7d 100644 --- a/src/EmailUtils.php +++ b/src/EmailUtils.php @@ -20,11 +20,7 @@ class EmailUtils */ public static function inline_styles($html, $css = '') { - if ($css) { - $domDocument = CssInliner::fromHtml($html)->inlineCss($css)->getDomDocument(); - } else { - $domDocument = CssInliner::fromHtml($html)->getDomDocument(); - } + $domDocument = CssInliner::fromHtml($html)->inlineCss($css)->getDomDocument(); HtmlPruner::fromDomDocument($domDocument)->removeElementsWithDisplayNone(); $html = CssToAttributeConverter::fromDomDocument($domDocument)