diff --git a/postmark.install b/postmark.install
index ff98d12..62ce996 100644
--- a/postmark.install
+++ b/postmark.install
@@ -5,6 +5,8 @@
  * Install and uninstall routines.
  */
 
+use Drupal\Component\Utility\DeprecationHelper;
+use Drupal\Core\Extension\Requirement\RequirementSeverity;
 use Drupal\Core\Link;
 use Drupal\postmark\PostmarkHandler;
 
@@ -54,7 +56,7 @@ function postmark_requirements($phase) {
 
   if (PostmarkHandler::checkLibrary() === FALSE) {
     $requirements['postmark']['description'] = t('The Postmark library has not been installed correctly.');
-    $requirements['postmark']['severity'] = REQUIREMENT_ERROR;
+    $requirements['postmark']['severity'] = DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.2.0', fn() => RequirementSeverity::Error, fn() => REQUIREMENT_ERROR);
   }
   else {
     $config = \Drupal::config('postmark.settings');
@@ -65,11 +67,11 @@ function postmark_requirements($phase) {
       $requirements['postmark']['description'] = t('The Postmark library is installed but API settings are not configured. Please check your @link.', [
         '@link' => Link::createFromRoute(t('settings'), 'postmark.settings')->toString(),
       ]);
-      $requirements['postmark']['severity'] = REQUIREMENT_WARNING;
+      $requirements['postmark']['severity'] = DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.2.0', fn() => RequirementSeverity::Warning, fn() => REQUIREMENT_WARNING);
     }
     else {
       $requirements['postmark']['description'] = t('The Postmark library is installed correctly. API settings are configured.');
-      $requirements['postmark']['severity'] = REQUIREMENT_OK;
+      $requirements['postmark']['severity'] = DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.2.0', fn() => RequirementSeverity::OK, fn() => REQUIREMENT_OK);
     }
   }
 
diff --git a/postmark.module b/postmark.module
index 04ad069..576c8c5 100644
--- a/postmark.module
+++ b/postmark.module
@@ -1,5 +1,12 @@
 <?php
 
+/**
+ * @file
+ */
+
+use Drupal\Core\Hook\Attribute\LegacyHook;
+use Drupal\postmark\Hook\PostmarkHooks;
+
 /**
  * @file
  * Tntegrate the third party Postmark mail service with Drupal.
@@ -8,7 +15,7 @@
 /**
  * Implements hook_mail().
  */
+#[LegacyHook]
 function postmark_mail($key, &$message, $params) {
-  $message['subject'] = t('Postmark Test Run Email');
-  $message['body'][] = t('Your site is properly configured to send emails using the Postmark library.');
+  \Drupal::service(PostmarkHooks::class)->mail($key, $message, $params);
 }
diff --git a/postmark.services.yml b/postmark.services.yml
index acb77e8..d61239e 100644
--- a/postmark.services.yml
+++ b/postmark.services.yml
@@ -6,3 +6,7 @@ services:
     class: Drupal\Core\Logger\LoggerChannel
     factory: logger.factory:get
     arguments: ['postmark']
+
+  Drupal\postmark\Hook\PostmarkHooks:
+    class: Drupal\postmark\Hook\PostmarkHooks
+    autowire: true
diff --git a/src/Hook/PostmarkHooks.php b/src/Hook/PostmarkHooks.php
new file mode 100644
index 0000000..2525c1b
--- /dev/null
+++ b/src/Hook/PostmarkHooks.php
@@ -0,0 +1,27 @@
+<?php
+
+namespace Drupal\postmark\Hook;
+
+use Drupal\Core\Hook\Attribute\Hook;
+use Drupal\Core\StringTranslation\StringTranslationTrait;
+
+/**
+ * Hook implementations for postmark.
+ */
+class PostmarkHooks {
+  use StringTranslationTrait;
+  /**
+   * @file
+   * Tntegrate the third party Postmark mail service with Drupal.
+   */
+
+  /**
+   * Implements hook_mail().
+   */
+  #[Hook('mail')]
+  public function mail($key, &$message, $params) {
+    $message['subject'] = $this->t('Postmark Test Run Email');
+    $message['body'][] = $this->t('Your site is properly configured to send emails using the Postmark library.');
+  }
+
+}
diff --git a/src/Plugin/Mail/PostmarkMail.php b/src/Plugin/Mail/PostmarkMail.php
index 797d0b1..6f0a762 100644
--- a/src/Plugin/Mail/PostmarkMail.php
+++ b/src/Plugin/Mail/PostmarkMail.php
@@ -7,7 +7,6 @@ use Drupal\Core\Mail\MailInterface;
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Drupal\postmark\PostmarkHandler;
 use Html2Text\Html2Text;
-use Drupal\Component\Utility\Html;
 use Psr\Log\LoggerInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -88,7 +87,7 @@ class PostmarkMail implements MailInterface, ContainerFactoryPluginInterface {
     // If text format is specified in settings, run the message through it.
     $format = $this->config->get('format_filter');
     if (!empty($format)) {
-      $message['body'] = check_markup($message['body'], $format, $message['langcode']);
+      $message['body'] = ['#type' => 'processed_text', '#text' => $message['body'], '#format' => $format, '#langcode' => $message['langcode']];
     }
 
     return $message;
