diff --git a/sendgrid_integration.install b/sendgrid_integration.install
index 0b7b2c4..6116cac 100644
--- a/sendgrid_integration.install
+++ b/sendgrid_integration.install
@@ -4,7 +4,9 @@
  * @file
  * Contains install and update functions for SendGrid Integration
  */
-
+use Drupal\Component\Utility\DeprecationHelper;
+use Drupal\filter\FilterFormatRepositoryInterface;
+use Drupal\Core\Extension\Requirement\RequirementSeverity;
 use Drupal\Core\Url;
 use Drupal\mailsystem\MailsystemManager;
 
@@ -18,7 +20,7 @@ function sendgrid_integration_install() {
 
   // Update defaults for test email.
   $config->set('test_defaults.to', $site_settings->get('mail'));
-  $config->set('test_defaults.body.format', filter_fallback_format());
+  $config->set('test_defaults.body.format', DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.4.0', fn() => \Drupal::service(FilterFormatRepositoryInterface::class)->getFallbackFormatId(), fn() => filter_fallback_format()));
   $config->save();
 
   // Set the mailsystem for the test email.
@@ -42,7 +44,7 @@ function sendgrid_integration_requirements($phase) {
         $requirements['sendgrid_integration'] = [
           'title' => t('SendGrid Integration Settings'),
           'value' => t('API Key Not Set'),
-          'severity' => REQUIREMENT_ERROR,
+          'severity' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.2.0', fn() => RequirementSeverity::Error, fn() => REQUIREMENT_ERROR),
           'description' => t('You need to <a href="@url">add a SendGrid API Secret Key</a> for Drupal to be able to deliver mail through SendGrid Integration.', [
             '@url' => Url::fromRoute('sendgrid_integration.settings_form')
               ->toString(),
@@ -52,7 +54,7 @@ function sendgrid_integration_requirements($phase) {
       else {
         $requirements['sendgrid_integration'] = [
           'title' => t('SendGrid Integration Settings'),
-          'severity' => REQUIREMENT_OK,
+          'severity' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.2.0', fn() => RequirementSeverity::OK, fn() => REQUIREMENT_OK),
           'value' => t('API Secret Key saved'),
         ];
       }
diff --git a/sendgrid_integration.module b/sendgrid_integration.module
index f32031d..0c084f5 100644
--- a/sendgrid_integration.module
+++ b/sendgrid_integration.module
@@ -6,7 +6,8 @@
  *
  * Provides module configuration and help functionality.
  */
-
+use Drupal\Core\Hook\Attribute\LegacyHook;
+use Drupal\sendgrid_integration\Hook\SendgridIntegrationHooks;
 use Drupal\Core\Routing\RouteMatchInterface;
 use Drupal\Core\Site\Settings;
 
@@ -19,38 +20,17 @@ if (\Drupal::hasService('ludwig.require_once')) {
 /**
  * Implements hook_help().
  */
-function sendgrid_integration_help($route_name, RouteMatchInterface $route_match) {
-  $output = '';
-  switch ($route_name) {
-    case 'help.page.sendgrid_integration':
-      $output .= '<h3>' . \Drupal::translation()->translate('About') . '</h3>';
-      $output .= '<p>' . \Drupal::translation()
-          ->translate('Module provides own implementation of MailSystemIntegration, replacing the default implementation and uses SendGrid Web API instead.') . '</p>';
-  }
-  return $output;
+#[LegacyHook]
+function sendgrid_integration_help($route_name, RouteMatchInterface $route_match)
+{
+    return \Drupal::service(SendgridIntegrationHooks::class)->help($route_name, $route_match);
 }
 
 /**
  * Implements hook_mail().
  */
-function sendgrid_integration_mail($key, &$message, $params) {
-  $message['module'] = 'sendgrid_integration';
-  $message['key'] = $key;
-  $message['subject'] = $params['subject'];
-  $message['body'] = explode(
-    Settings::get('mail_line_endings', PHP_EOL) . Settings::get('mail_line_endings', PHP_EOL),
-    $params['body']
-  );
-  if (isset($params['include_test_attachment'])) {
-    $message['attachments'][] = \Drupal::service('file_system')
-      ->realpath('core/misc/druplicon.png');
-  }
-  if (isset($params['Reply-To']) && !empty($params['Reply-To'])) {
-    $message['headers']['Reply-To'] = $params['Reply-To'];
-  }
-  else {
-    if (isset($params['reply_to']) && !empty($params['reply_to'])) {
-      $message['headers']['Reply-To'] = $params['reply_to'];
-    }
-  }
+#[LegacyHook]
+function sendgrid_integration_mail($key, &$message, $params)
+{
+    \Drupal::service(SendgridIntegrationHooks::class)->mail($key, $message, $params);
 }
diff --git a/sendgrid_integration.services.yml b/sendgrid_integration.services.yml
new file mode 100644
index 0000000..4f910ac
--- /dev/null
+++ b/sendgrid_integration.services.yml
@@ -0,0 +1,5 @@
+
+services:
+  Drupal\sendgrid_integration\Hook\SendgridIntegrationHooks:
+    class: Drupal\sendgrid_integration\Hook\SendgridIntegrationHooks
+    autowire: true
diff --git a/src/Form/SendGridTestForm.php b/src/Form/SendGridTestForm.php
index fd141c3..0f6413a 100644
--- a/src/Form/SendGridTestForm.php
+++ b/src/Form/SendGridTestForm.php
@@ -156,7 +156,7 @@ class SendGridTestForm extends FormBase {
     $params = $config->get('test_defaults');
 
     $params['include_test_attachment'] = $form_state->getValue('include_attachment');
-    $params['body'] = check_markup($params['body']['value'], $params['body']['format']);
+    $params['body'] = ['#type' => 'processed_text', '#text' => $params['body']['value'], '#format' => $params['body']['format']];
 
     // Attempt to send the email and post a message if it was successful.
     if ($config->get('test_defaults.from_name')) {
diff --git a/src/Hook/SendgridIntegrationHooks.php b/src/Hook/SendgridIntegrationHooks.php
new file mode 100644
index 0000000..61b632f
--- /dev/null
+++ b/src/Hook/SendgridIntegrationHooks.php
@@ -0,0 +1,46 @@
+<?php
+
+namespace Drupal\sendgrid_integration\Hook;
+
+use Drupal\Core\Routing\RouteMatchInterface;
+use Drupal\Core\Site\Settings;
+use Drupal\Core\Hook\Attribute\Hook;
+/**
+ * Hook implementations for sendgrid_integration.
+ */
+class SendgridIntegrationHooks
+{
+    /**
+     * Implements hook_help().
+     */
+    #[Hook('help')]
+    public static function help($route_name, \Drupal\Core\Routing\RouteMatchInterface $route_match)
+    {
+        $output = '';
+        switch ($route_name) {
+            case 'help.page.sendgrid_integration':
+                $output .= '<h3>' . \Drupal::translation()->translate('About') . '</h3>';
+                $output .= '<p>' . \Drupal::translation()->translate('Module provides own implementation of MailSystemIntegration, replacing the default implementation and uses SendGrid Web API instead.') . '</p>';
+        }
+        return $output;
+    }
+    /**
+     * Implements hook_mail().
+     */
+    #[Hook('mail')]
+    public static function mail($key, &$message, $params)
+    {
+        $message['module'] = 'sendgrid_integration';
+        $message['key'] = $key;
+        $message['subject'] = $params['subject'];
+        $message['body'] = explode(\Drupal\Core\Site\Settings::get('mail_line_endings', PHP_EOL) . \Drupal\Core\Site\Settings::get('mail_line_endings', PHP_EOL), $params['body']);
+        if (isset($params['include_test_attachment'])) {
+            $message['attachments'][] = \Drupal::service('file_system')->realpath('core/misc/druplicon.png');
+        }
+        if (isset($params['Reply-To']) && !empty($params['Reply-To'])) {
+            $message['headers']['Reply-To'] = $params['Reply-To'];
+        } else if (isset($params['reply_to']) && !empty($params['reply_to'])) {
+            $message['headers']['Reply-To'] = $params['reply_to'];
+        }
+    }
+}
