Skip to content

Commit

Permalink
fix display of <> emails
Browse files Browse the repository at this point in the history
  • Loading branch information
lekoala committed Apr 4, 2024
1 parent 0b09eb9 commit ff48e51
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/SparkPostAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -343,7 +344,7 @@ public function getEditForm($id = null, $fields = null)
// Show default from email
$defaultEmail = SparkPostHelper::resolveDefaultFromEmail();
$defaultEmailDisplayed = EmailUtils::stringify($defaultEmail);
$toolsHtml .= "<p>Default sending email: " . $defaultEmailDisplayed . " (" . SparkPostHelper::resolveDefaultFromEmailType() . ")</p>";
$toolsHtml .= "<p>Default sending email: " . Convert::raw2xml($defaultEmailDisplayed) . " (" . SparkPostHelper::resolveDefaultFromEmailType() . ")</p>";
if (!SparkPostHelper::isEmailDomainReady($defaultEmailDisplayed)) {
$toolsHtml .= '<p style="color:red">The default email is not ready to send emails</p>';
}
Expand Down
1 change: 1 addition & 0 deletions src/SparkPostHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ff48e51

Please sign in to comment.