From ff48e5177c86d921a5ddb7f489be25d40d63285a Mon Sep 17 00:00:00 2001 From: Thomas Date: Thu, 4 Apr 2024 17:01:32 +0200 Subject: [PATCH] fix display of <> emails --- src/SparkPostAdmin.php | 3 ++- src/SparkPostHelper.php | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/SparkPostAdmin.php b/src/SparkPostAdmin.php index f80790f..b0089f7 100644 --- a/src/SparkPostAdmin.php +++ b/src/SparkPostAdmin.php @@ -29,6 +29,7 @@ use SilverStripe\Security\Permission; use LeKoala\SparkPost\SparkPostHelper; use SilverStripe\Control\HTTPResponse; +use SilverStripe\Core\Convert; use SilverStripe\Forms\CompositeField; use SilverStripe\SiteConfig\SiteConfig; use SilverStripe\Forms\GridField\GridField; @@ -343,7 +344,7 @@ public function getEditForm($id = null, $fields = null) // Show default from email $defaultEmail = SparkPostHelper::resolveDefaultFromEmail(); $defaultEmailDisplayed = EmailUtils::stringify($defaultEmail); - $toolsHtml .= "

Default sending email: " . $defaultEmailDisplayed . " (" . SparkPostHelper::resolveDefaultFromEmailType() . ")

"; + $toolsHtml .= "

Default sending email: " . Convert::raw2xml($defaultEmailDisplayed) . " (" . SparkPostHelper::resolveDefaultFromEmailType() . ")

"; if (!SparkPostHelper::isEmailDomainReady($defaultEmailDisplayed)) { $toolsHtml .= '

The default email is not ready to send emails

'; } diff --git a/src/SparkPostHelper.php b/src/SparkPostHelper.php index cadec71..aa57e14 100644 --- a/src/SparkPostHelper.php +++ b/src/SparkPostHelper.php @@ -295,6 +295,7 @@ public static function isEmailDomainReady($email) if (!$email) { return false; } + $email = EmailUtils::get_email_from_rfc_email($email); $parts = explode("@", $email); if (count($parts) != 2) { return false;