diff --git a/mandrill.info.yml b/mandrill.info.yml
index 4546354..edabcbb 100644
--- a/mandrill.info.yml
+++ b/mandrill.info.yml
@@ -3,6 +3,7 @@ type: module
 description: 'Allow for site emails to be sent through Mandrill.'
 package: Mandrill
 core: 8.x
+core_version_requirement: ^8 || ^9
 
 configure: mandrill.admin
 
diff --git a/mandrill.module b/mandrill.module
index 799c62d..7371252 100644
--- a/mandrill.module
+++ b/mandrill.module
@@ -107,7 +107,7 @@ function mandrill_get_module_key_names() {
     'default-system' => "Site-wide default",
   );
   $descriptions = array();
-  foreach (system_rebuild_module_data() as $item) {
+  foreach (\Drupal::service('extension.list.module')->getList() as $item) {
     if ($item->status && !empty($item->info['name'])) {
       $descriptions[strtolower($item->getName())] = (empty($item->info['package']) ? '' : $item->info['package']) . ' » ' . t(':module module', array(':module' => $item->info['name']));
     }
@@ -213,7 +213,7 @@ function mandrill_mail_key_blacklist() {
  *   a comma delimited list of email addresses in 1 of 2 forms:
  *   user@domain.com
  *   any number of names <user@domain.com>
- * 
+ *
  * @return array
  *   array of email addresses
  */
diff --git a/modules/mandrill_activity/mandrill_activity.info.yml b/modules/mandrill_activity/mandrill_activity.info.yml
index d5ea871..004bdd1 100644
--- a/modules/mandrill_activity/mandrill_activity.info.yml
+++ b/modules/mandrill_activity/mandrill_activity.info.yml
@@ -2,6 +2,7 @@ name: 'Mandrill Activity'
 description: 'View activity for an email address associated with any entity.'
 package: Mandrill
 core: 8.x
+core_version_requirement: ^8 || ^9
 dependencies:
   - mandrill:mandrill
   - entity:entity
diff --git a/modules/mandrill_activity/src/Controller/MandrillActivityController.php b/modules/mandrill_activity/src/Controller/MandrillActivityController.php
index 97804c7..f50f92e 100644
--- a/modules/mandrill_activity/src/Controller/MandrillActivityController.php
+++ b/modules/mandrill_activity/src/Controller/MandrillActivityController.php
@@ -47,7 +47,7 @@ class MandrillActivityController extends ControllerBase {
       );
 
       $content['activity_table'][$index]['timestamp'] = array(
-        '#markup' => format_date($message['ts'], 'short'),
+        '#markup' => \Drupal::service('date.formatter')->format($message['ts'], 'short'),
       );
 
       $content['activity_table'][$index]['state'] = array(
diff --git a/modules/mandrill_activity/src/Form/MandrillActivityDeleteForm.php b/modules/mandrill_activity/src/Form/MandrillActivityDeleteForm.php
index 069f10f..eddf388 100644
--- a/modules/mandrill_activity/src/Form/MandrillActivityDeleteForm.php
+++ b/modules/mandrill_activity/src/Form/MandrillActivityDeleteForm.php
@@ -47,7 +47,7 @@ class MandrillActivityDeleteForm extends EntityConfirmFormBase {
 
     \Drupal::service('router.builder')->setRebuildNeeded();
 
-    drupal_set_message($this->t('Mandrill Activity %label has been deleted.', array('%label' => $this->entity->label())));
+    $this->messenger()->addStatus($this->t('Mandrill Activity %label has been deleted.', array('%label' => $this->entity->label())));
 
     $form_state->setRedirectUrl($this->getCancelUrl());
   }
diff --git a/modules/mandrill_activity/src/Form/MandrillActivityForm.php b/modules/mandrill_activity/src/Form/MandrillActivityForm.php
index ff74b7c..24f9050 100644
--- a/modules/mandrill_activity/src/Form/MandrillActivityForm.php
+++ b/modules/mandrill_activity/src/Form/MandrillActivityForm.php
@@ -9,9 +9,7 @@ namespace Drupal\mandrill_activity\Form;
 
 use Drupal\Core\Entity\EntityForm;
 use Drupal\Core\Entity\EntityTypeInterface;
-use Drupal\Core\Entity\Query\QueryFactory;
 use Drupal\Core\Form\FormStateInterface;
-use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
  * Form controller for the MandrillActivity entity edit form.
@@ -20,30 +18,6 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
  */
 class MandrillActivityForm extends EntityForm {
 
-  /**
-   * The entity query.
-   *
-   * @var \Drupal\Core\Entity\Query\QueryFactory
-   */
-  protected $entityQuery;
-
-  /**
-   * @param \Drupal\Core\Entity\Query\QueryFactory $entity_query
-   *   The entity query.
-   */
-  public function __construct(QueryFactory $entity_query) {
-    $this->entityQuery = $entity_query;
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public static function create(ContainerInterface $container) {
-    return new static(
-      $container->get('entity.query')
-    );
-  }
-
   /**
    * {@inheritdoc}
    */
@@ -133,7 +107,7 @@ class MandrillActivityForm extends EntityForm {
 
     if (!empty($form_entity_type)) {
       // Prep the bundle list before creating the form item.
-      $bundle_info = \Drupal::entityManager()->getBundleInfo($form_entity_type);
+      $bundle_info = \Drupal::service('entity_type.bundle.info')->getBundleInfo($form_entity_type);
 
       $bundles = array('' => t('-- Select --'));
 
@@ -200,7 +174,7 @@ class MandrillActivityForm extends EntityForm {
    */
   public function validateForm(array &$form, FormStateInterface $form_state) {
     if ($form_state->isSubmitted()) {
-      $entity = $this->entityQuery->get('mandrill_activity')
+      $entity = $this->entityTypeManager->getStorage('mandrill_activity')->getQuery()
         ->condition('entity_type', $form_state->getValue('entity_type'))
         ->condition('bundle', $form_state->getValue('bundle'))
         ->execute();
@@ -234,7 +208,7 @@ class MandrillActivityForm extends EntityForm {
    *   TRUE if the entity exists.
    */
   public function exists($id) {
-    $entity = $this->entityQuery->get('mandrill_activity')
+    $entity = $this->entityTypeManager->getStorage('mandrill_activity')->getQuery()
       ->condition('id', $id)
       ->execute();
     return (bool) $entity;
@@ -254,7 +228,7 @@ class MandrillActivityForm extends EntityForm {
   public function fieldmapOptions($entity_type, $entity_bundle = NULL) {
     $options = array('' => t('-- Select --'));
 
-    $fields = \Drupal::entityManager()->getFieldMap();
+    $fields =  \Drupal::service('entity_field.manager')->getFieldMap();
 
     if (isset($fields[$entity_type])) {
       foreach ($fields[$entity_type] as $key => $field) {
diff --git a/modules/mandrill_activity/src/Plugin/Derivative/MandrillActivityLocalTasks.php b/modules/mandrill_activity/src/Plugin/Derivative/MandrillActivityLocalTasks.php
index 372d06b..221495c 100644
--- a/modules/mandrill_activity/src/Plugin/Derivative/MandrillActivityLocalTasks.php
+++ b/modules/mandrill_activity/src/Plugin/Derivative/MandrillActivityLocalTasks.php
@@ -8,7 +8,7 @@
 namespace Drupal\mandrill_activity\Plugin\Derivative;
 
 use Drupal\Component\Plugin\Derivative\DeriverBase;
-use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Entity\EntityTypeManagerInterface;
 use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface;
 use Drupal\mandrill_activity\Entity\MandrillActivity;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -19,20 +19,20 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
 class MandrillActivityLocalTasks extends DeriverBase implements ContainerDeriverInterface {
 
   /**
-   * The entity manager.
+   * The entity type manager.
    *
-   * @var \Drupal\Core\Entity\EntityManagerInterface
+   * @var \Drupal\Core\Entity\EntityTypeManagerInterface
    */
-  protected $entityManager;
+  protected $entityTypeManager;
 
   /**
    * Constructor.
    *
-   * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
-   *   The entity manager.
+   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
+   *   The entity type manager.
    */
-  public function __construct(EntityManagerInterface $entity_manager) {
-    $this->entityManager = $entity_manager;
+  public function __construct(EntityTypeManagerInterface $entity_type_manager) {
+    $this->entityTypeManager = $entity_type_manager;
   }
 
   /**
@@ -40,7 +40,7 @@ class MandrillActivityLocalTasks extends DeriverBase implements ContainerDeriver
    */
   public static function create(ContainerInterface $container, $base_plugin_id) {
     return new static(
-      $container->get('entity.manager')
+      $container->get('entity_type.manager')
     );
   }
 
@@ -50,7 +50,7 @@ class MandrillActivityLocalTasks extends DeriverBase implements ContainerDeriver
   public function getDerivativeDefinitions($base_plugin_definition) {
     $activity_ids = \Drupal::entityQuery('mandrill_activity')->execute();
 
-    $entity_definitions = $this->entityManager->getDefinitions();
+    $entity_definitions = $this->entityTypeManager->getDefinitions();
 
     $activity_entities = MandrillActivity::loadMultiple($activity_ids);
 
diff --git a/modules/mandrill_activity/src/Tests/MandrillActivityTestCase.php b/modules/mandrill_activity/src/Tests/MandrillActivityTestCase.php
index b860aa0..7ff63b7 100644
--- a/modules/mandrill_activity/src/Tests/MandrillActivityTestCase.php
+++ b/modules/mandrill_activity/src/Tests/MandrillActivityTestCase.php
@@ -7,14 +7,13 @@
 
 namespace Drupal\mandrill_activity\Tests;
 
-use Drupal\simpletest\WebTestBase;
-
+use Drupal\Tests\BrowserTestBase;
 /**
  * Test Mandrill Activity functionality.
  *
  * @group mandrill
  */
-class MandrillActivityTestCase extends WebTestBase {
+class MandrillActivityTestCase extends BrowserTestBase {
 
   /**
    * Modules to enable.
diff --git a/modules/mandrill_reports/mandrill_reports.info.yml b/modules/mandrill_reports/mandrill_reports.info.yml
index 7528078..a53d57b 100644
--- a/modules/mandrill_reports/mandrill_reports.info.yml
+++ b/modules/mandrill_reports/mandrill_reports.info.yml
@@ -1,6 +1,7 @@
 name: 'Mandrill Reports'
 description: 'Providing reporting on activity through Mandrill.'
 core: 8.x
+core_version_requirement: ^8 || ^9
 package: Mandrill
 dependencies:
   - mandrill:mandrill
diff --git a/modules/mandrill_reports/src/Tests/MandrillReportsTestCase.php b/modules/mandrill_reports/src/Tests/MandrillReportsTestCase.php
index 95f7779..254c23d 100644
--- a/modules/mandrill_reports/src/Tests/MandrillReportsTestCase.php
+++ b/modules/mandrill_reports/src/Tests/MandrillReportsTestCase.php
@@ -7,14 +7,14 @@
 
 namespace Drupal\mandrill_reports\Tests;
 
-use Drupal\simpletest\WebTestBase;
+use Drupal\Tests\BrowserTestBase;
 
 /**
  * Test Mandrill Reports functionality.
  *
  * @group mandrill
  */
-class MandrillReportsTestCase extends WebTestBase {
+class MandrillReportsTestCase extends BrowserTestBase {
 
   /**
    * Modules to enable.
diff --git a/modules/mandrill_template/mandrill_template.info.yml b/modules/mandrill_template/mandrill_template.info.yml
index d2220ef..28ef8fc 100644
--- a/modules/mandrill_template/mandrill_template.info.yml
+++ b/modules/mandrill_template/mandrill_template.info.yml
@@ -1,6 +1,7 @@
 name: 'Mandrill Template'
 description: 'Use Mandrill templates for messages sent through Mandrill.'
 core: 8.x
+core_version_requirement: ^8 || ^9
 package: Mandrill
 dependencies:
   - mandrill:mandrill
diff --git a/modules/mandrill_template/src/Form/MandrillTemplateMapDeleteForm.php b/modules/mandrill_template/src/Form/MandrillTemplateMapDeleteForm.php
index b906da6..92ec83e 100644
--- a/modules/mandrill_template/src/Form/MandrillTemplateMapDeleteForm.php
+++ b/modules/mandrill_template/src/Form/MandrillTemplateMapDeleteForm.php
@@ -47,7 +47,7 @@ class MandrillTemplateMapDeleteForm extends EntityConfirmFormBase {
 
     \Drupal::service('router.builder')->setRebuildNeeded();
 
-    drupal_set_message($this->t('Mandrill Template Map %label has been deleted.', array('%label' => $this->entity->label())));
+    $this->messenger()->addStatus($this->t('Mandrill Template Map %label has been deleted.', array('%label' => $this->entity->label())));
 
     $form_state->setRedirectUrl($this->getCancelUrl());
   }
diff --git a/modules/mandrill_template/src/Form/MandrillTemplateMapForm.php b/modules/mandrill_template/src/Form/MandrillTemplateMapForm.php
index 729d767..1f6cefc 100644
--- a/modules/mandrill_template/src/Form/MandrillTemplateMapForm.php
+++ b/modules/mandrill_template/src/Form/MandrillTemplateMapForm.php
@@ -9,11 +9,9 @@ namespace Drupal\mandrill_template\Form;
 
 use Drupal\Core\Entity\EntityForm;
 use Drupal\Core\Entity\EntityTypeInterface;
-use Drupal\Core\Entity\Query\QueryFactory;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Link;
 use Drupal\Core\Url;
-use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
  * Form controller for the MandrillTemplateMap entity edit form.
@@ -22,30 +20,6 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
  */
 class MandrillTemplateMapForm extends EntityForm {
 
-  /**
-   * The entity query.
-   *
-   * @var \Drupal\Core\Entity\Query\QueryFactory
-   */
-  protected $entityQuery;
-
-  /**
-   * @param \Drupal\Core\Entity\Query\QueryFactory $entity_query
-   *   The entity query.
-   */
-  public function __construct(QueryFactory $entity_query) {
-    $this->entityQuery = $entity_query;
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public static function create(ContainerInterface $container) {
-    return new static(
-      $container->get('entity.query')
-    );
-  }
-
   /**
    * {@inheritdoc}
    */
@@ -93,7 +67,7 @@ class MandrillTemplateMapForm extends EntityForm {
     }
     // Check if the currently configured template still exists.
     if (!empty($map->template_id) && !array_key_exists($map->template_id, $template_names)) {
-      drupal_set_message(t('The configured Mandrill template is no longer available, please select a valid one.'), 'warning');
+      $this->messenger()->addWarning(t('The configured Mandrill template is no longer available, please select a valid one.'));
     }
     if (!empty($templates)) {
       $options = array('' => t('-- Select --'));
@@ -161,12 +135,12 @@ class MandrillTemplateMapForm extends EntityForm {
           '#default_value' => isset($map->mailsystem_key) ? $map->mailsystem_key : '',
         );
         if (!$available_modules) {
-          drupal_set_message(t("All email-using modules that have been assigned to Mandrill are already assigned to other template maps"), 'warning');
+          $this->messenger()->addWarning(t("All email-using modules that have been assigned to Mandrill are already assigned to other template maps"));
         }
       }
 
       if (!$mandrill_in_use) {
-        drupal_set_message(t("You have not assigned any Modules to use Mandrill: to use this template, make sure Mandrill is assigned in Mailsystem."), 'warning');
+        $this->messenger()->addWarning(t("You have not assigned any Modules to use Mandrill: to use this template, make sure Mandrill is assigned in Mailsystem."));
       }
     }
     else {
@@ -197,7 +171,7 @@ class MandrillTemplateMapForm extends EntityForm {
   }
 
   public function exists($id) {
-    $entity = $this->entityQuery->get('mandrill_template_map')
+    $entity = $this->entityTypeManager->getStorage('mandrill_template_map')->getQuery()
       ->condition('id', $id)
       ->execute();
     return (bool) $entity;
diff --git a/modules/mandrill_template/src/Tests/MandrillTemplateTestCase.php b/modules/mandrill_template/src/Tests/MandrillTemplateTestCase.php
index 28b8cd2..c9d1ffb 100644
--- a/modules/mandrill_template/src/Tests/MandrillTemplateTestCase.php
+++ b/modules/mandrill_template/src/Tests/MandrillTemplateTestCase.php
@@ -7,14 +7,14 @@
 
 namespace Drupal\mandrill_template\Tests;
 
-use Drupal\simpletest\WebTestBase;
+use Drupal\Tests\BrowserTestBase;
 
 /**
  * Test Mandrill Template functionality.
  *
  * @group mandrill
  */
-class MandrillTemplateTestCase extends WebTestBase {
+class MandrillTemplateTestCase extends BrowserTestBase {
 
   /**
    * Modules to enable.
diff --git a/src/Form/MandrillAdminSettingsForm.php b/src/Form/MandrillAdminSettingsForm.php
index 0e2b52c..660c160 100644
--- a/src/Form/MandrillAdminSettingsForm.php
+++ b/src/Form/MandrillAdminSettingsForm.php
@@ -11,6 +11,7 @@ use Drupal\Core\Url;
 use Drupal\Core\Render\RendererInterface;
 use Drupal\mandrill\MandrillServiceInterface;
 use Drupal\mandrill\MandrillAPIInterface;
+use Drupal\Core\Link;
 
 /**
  * Implements an Mandrill Admin Settings form.
@@ -98,11 +99,11 @@ class MandrillAdminSettingsForm extends ConfigFormBase {
     $form['mandrill_api_key'] = array(
       '#title' => $this->t('Mandrill API Key'),
       '#type' => 'textfield',
-      '#description' => $this->t('Create or grab your API key from the %link.', array('%link' => $this->l($this->t('Mandrill settings'), Url::fromUri('https://mandrillapp.com/settings/index')))),
+      '#description' => $this->t('Create or grab your API key from the %link.', array('%link' => Link::fromTextAndUrl($this->t('Mandrill settings'), Url::fromUri('https://mandrillapp.com/settings/index'))->toString())),
       '#default_value' => $key,
     );
     if (!$this->mandrillAPI->isLibraryInstalled()) {
-      drupal_set_message($this->t('The Mandrill PHP library is not installed. Please see installation directions in README.txt'), 'warning');
+      $this->messenger()->addWarning($this->t('The Mandrill PHP library is not installed. Please see installation directions in README.txt'));
     }
     else if ($key) {
       $mailSystemPath = Url::fromRoute('mailsystem.settings');
@@ -129,17 +130,17 @@ class MandrillAdminSettingsForm extends ConfigFormBase {
           '#markup' => $this->t('Mandrill is currently configured to be used by the following Module Keys. To change these settings or '
             . 'configure additional systems to use Mandrill, use %link.<br /><br />%table',
             array(
-              '%link' => $this->l($this->t('Mail System'), $mailSystemPath),
+              '%link' => Link::fromTextAndUrl($this->t('Mail System'), $mailSystemPath)->toString(),
               '%table' => $this->renderer->render($usage_array),
             )),
         );
       }
       elseif (!$form_state->get('rebuild')) {
-        drupal_set_message($this->t(
+        $this->messenger()->addWarning($this->t(
           'PLEASE NOTE: Mandrill is not currently configured for use by Drupal. In order to route your email through Mandrill, '
           . 'you must configure at least one MailSystemInterface (other than mandrill) to use "MandrillMailSystem" in %link, or '
           . 'you will only be able to send Test Emails through Mandrill.',
-          array('%link' => $this->l($this->t('Mail System'), $mailSystemPath))), 'warning');
+          array('%link' => Link::fromTextAndUrl($this->t('Mail System'), $mailSystemPath)->toString())));
       }
       $form['email_options'] = array(
         '#type' => 'fieldset',
@@ -228,8 +229,8 @@ class MandrillAdminSettingsForm extends ConfigFormBase {
         '#type' => 'checkbox',
         '#description' => $this->t('If you select Mandrill as the site-wide default email sender in %mailsystem and check this box, any messages that are sent through Mandrill using module/key pairs that are not specifically registered in mailsystem will cause a message to be written to the %systemlog (type: Mandrill, severity: info). Enable this to identify keys and modules for automated emails for which you would like to have more granular control. It is not recommended to leave this box checked for extended periods, as it slows Mandrill and can clog your logs.',
           array(
-            '%mailsystem' => $this->l($this->t('Mail System'), $mailSystemPath),
-            '%systemlog' => $this->l($this->t('system log'), Url::fromRoute('dblog.overview')),
+            '%mailsystem' => Link::fromTextAndUrl($this->t('Mail System'), $mailSystemPath)->toString(),
+            '%systemlog' => Link::fromTextAndUrl($this->t('system log'), Url::fromRoute('dblog.overview'))->toString(),
           )),
         '#default_value' => $config->get('mandrill_log_defaulted_sends'),
       );
diff --git a/src/Form/MandrillAdminTestForm.php b/src/Form/MandrillAdminTestForm.php
index 64789a1..ca81054 100644
--- a/src/Form/MandrillAdminTestForm.php
+++ b/src/Form/MandrillAdminTestForm.php
@@ -142,7 +142,7 @@ class MandrillAdminTestForm extends ConfirmFormBase {
 
     // Ensure we have a mailer and send the message.
     if (isset($mailer) && $mailer->mail($message)) {
-      drupal_set_message($this->t('Test email has been sent.'));
+      $this->messenger()->addStatus($this->t('Test email has been sent.'));
     }
   }
 
diff --git a/src/MandrillAPI.php b/src/MandrillAPI.php
index f16cd7a..7a49de2 100644
--- a/src/MandrillAPI.php
+++ b/src/MandrillAPI.php
@@ -60,7 +60,7 @@ class MandrillAPI implements MandrillAPIInterface {
         $messages = $mandrill->messages->search("email:{$email}");
       }
     } catch (\Exception $e) {
-      drupal_set_message(t('Mandrill: %message', array('%message' => $e->getMessage())), 'error');
+      \Drupal::messenger()->addError(t('Mandrill: %message', array('%message' => $e->getMessage())));
       $this->log->error($e->getMessage());
     }
     return $messages;
@@ -79,7 +79,7 @@ class MandrillAPI implements MandrillAPIInterface {
         $templates = $mandrill->templates->getList();
       }
     } catch (\Exception $e) {
-      drupal_set_message(t('Mandrill: %message', array('%message' => $e->getMessage())), 'error');
+      \Drupal::messenger()->addError(t('Mandrill: %message', array('%message' => $e->getMessage())));
       $this->log->error($e->getMessage());
     }
     return $templates;
@@ -97,7 +97,7 @@ class MandrillAPI implements MandrillAPIInterface {
         $accounts = $mandrill->subaccounts->getList();
       }
     } catch (\Exception $e) {
-      drupal_set_message(t('Mandrill: %message', array('%message' => $e->getMessage())), 'error');
+      \Drupal::messenger()->addError(t('Mandrill: %message', array('%message' => $e->getMessage())));
       $this->log->error($e->getMessage());
     }
     return $accounts;
@@ -115,7 +115,7 @@ class MandrillAPI implements MandrillAPIInterface {
         $webhooks = $mandrill->webhooks->getList();
       }
     } catch (\Exception $e) {
-      drupal_set_message(t('Mandrill: %message', array('%message' => $e->getMessage())), 'error');
+      \Drupal::messenger()->addError(t('Mandrill: %message', array('%message' => $e->getMessage())));
       $this->log->error($e->getMessage());
     }
     return $webhooks;
@@ -133,7 +133,7 @@ class MandrillAPI implements MandrillAPIInterface {
         $domains = $mandrill->inbound->domains();
       }
     } catch (\Exception $e) {
-      drupal_set_message(t('Mandrill: %message', array('%message' => $e->getMessage())), 'error');
+      \Drupal::messenger()->addError(t('Mandrill: %message', array('%message' => $e->getMessage())));
       $this->log->error($e->getMessage());
     }
     return $domains;
@@ -151,7 +151,7 @@ class MandrillAPI implements MandrillAPIInterface {
         $users = $mandrill->users->info();
       }
     } catch (\Exception $e) {
-      drupal_set_message(t('Mandrill: %message', array('%message' => $e->getMessage())), 'error');
+      \Drupal::messenger()->addError(t('Mandrill: %message', array('%message' => $e->getMessage())));
       $this->log->error($e->getMessage());
     }
     return $users;
@@ -169,7 +169,7 @@ class MandrillAPI implements MandrillAPIInterface {
         $tags = $mandrill->tags->info();
       }
     } catch (\Exception $e) {
-      drupal_set_message(t('Mandrill: %message', array('%message' => $e->getMessage())), 'error');
+      \Drupal::messenger()->addError(t('Mandrill: %message', array('%message' => $e->getMessage())));
       $this->log->error($e->getMessage());
     }
     return $tags;
@@ -191,7 +191,7 @@ class MandrillAPI implements MandrillAPIInterface {
         $tag = $mandrill->tags->info($tag);
       }
     } catch (\Exception $e) {
-      drupal_set_message(t('Mandrill: %message', array('%message' => $e->getMessage())), 'error');
+      \Drupal::messenger()->addError(t('Mandrill: %message', array('%message' => $e->getMessage())));
       $this->log->error($e->getMessage());
     }
     return $tag;
@@ -213,7 +213,7 @@ class MandrillAPI implements MandrillAPIInterface {
         $data = $mandrill->tags->timeSeries($tag);
       }
     } catch (\Exception $e) {
-      drupal_set_message(t('Mandrill: %message', array('%message' => $e->getMessage())), 'error');
+      \Drupal::messenger()->addError(t('Mandrill: %message', array('%message' => $e->getMessage())));
       $this->log->error($e->getMessage());
     }
     return $data;
@@ -232,7 +232,7 @@ class MandrillAPI implements MandrillAPIInterface {
         $data = $mandrill->tags->allTimeSeries();
       }
     } catch (\Exception $e) {
-      drupal_set_message(t('Mandrill: %message', array('%message' => $e->getMessage())), 'error');
+      \Drupal::messenger()->addError(t('Mandrill: %message', array('%message' => $e->getMessage())));
       $this->log->error($e->getMessage());
     }
     return $data;
@@ -250,7 +250,7 @@ class MandrillAPI implements MandrillAPIInterface {
         $senders = $mandrill->senders->getList();
       }
     } catch (\Exception $e) {
-      drupal_set_message(t('Mandrill: %message', array('%message' => $e->getMessage())), 'error');
+      \Drupal::messenger()->addError(t('Mandrill: %message', array('%message' => $e->getMessage())));
       $this->log->error($e->getMessage());
     }
     return $senders;
@@ -272,7 +272,7 @@ class MandrillAPI implements MandrillAPIInterface {
         $sender = $mandrill->senders->info($email);
       }
     } catch (\Exception $e) {
-      drupal_set_message(t('Mandrill: %message', array('%message' => $e->getMessage())), 'error');
+      \Drupal::messenger()->addError(t('Mandrill: %message', array('%message' => $e->getMessage())));
       $this->log->error($e->getMessage());
     }
     return $sender;
@@ -294,7 +294,7 @@ class MandrillAPI implements MandrillAPIInterface {
         $data = $mandrill->senders->timeSeries($email);
       }
     } catch (\Exception $e) {
-      drupal_set_message(t('Mandrill: %message', array('%message' => $e->getMessage())), 'error');
+      \Drupal::messenger()->addError(t('Mandrill: %message', array('%message' => $e->getMessage())));
       $this->log->error($e->getMessage());
     }
     return $data;
@@ -313,7 +313,7 @@ class MandrillAPI implements MandrillAPIInterface {
         $urls = $mandrill->urls->getList();
       }
     } catch (\Exception $e) {
-      drupal_set_message(t('Mandrill: %message', array('%message' => $e->getMessage())), 'error');
+      \Drupal::messenger()->addError(t('Mandrill: %message', array('%message' => $e->getMessage())));
       $this->log->error($e->getMessage());
     }
     return $urls;
@@ -335,7 +335,7 @@ class MandrillAPI implements MandrillAPIInterface {
         $data = $mandrill->urls->timeSeries($url);
       }
     } catch (\Exception $e) {
-      drupal_set_message(t('Mandrill: %message', array('%message' => $e->getMessage())), 'error');
+      \Drupal::messenger()->addError(t('Mandrill: %message', array('%message' => $e->getMessage())));
       $this->log->error($e->getMessage());
     }
     return $data;
@@ -353,7 +353,7 @@ class MandrillAPI implements MandrillAPIInterface {
         $routes = $mandrill->inbound->routes();
       }
     } catch (\Exception $e) {
-      drupal_set_message(t('Mandrill: %message', array('%message' => $e->getMessage())), 'error');
+      \Drupal::messenger()->addError(t('Mandrill: %message', array('%message' => $e->getMessage())));
       $this->log->error($e->getMessage());
     }
     return $routes;
@@ -374,7 +374,7 @@ class MandrillAPI implements MandrillAPIInterface {
         $result = $mandrill->inbound->addDomain($domain);
       }
     } catch (\Exception $e) {
-      drupal_set_message(t('Mandrill: %message', array('%message' => $e->getMessage())), 'error');
+      \Drupal::messenger()->addError(t('Mandrill: %message', array('%message' => $e->getMessage())));
       $this->log->error($e->getMessage());
     }
     return $result;
@@ -397,7 +397,7 @@ class MandrillAPI implements MandrillAPIInterface {
         $result = $mandrill->webhooks->add($GLOBALS['base_url'] . '/' . $path, $description, $events);
       }
     } catch (\Exception $e) {
-      drupal_set_message(t('Mandrill: %message', array('%message' => $e->getMessage())), 'error');
+      \Drupal::messenger()->addError(t('Mandrill: %message', array('%message' => $e->getMessage())));
       $this->log->error($e->getMessage());
     }
     return $result;
@@ -418,7 +418,7 @@ class MandrillAPI implements MandrillAPIInterface {
         $result = $mandrill->inbound->deleteDomain($domain);
       }
     } catch (\Exception $e) {
-      drupal_set_message(t('Mandrill: %message', array('%message' => $e->getMessage())), 'error');
+      \Drupal::messenger()->addError(t('Mandrill: %message', array('%message' => $e->getMessage())));
       $this->log->error($e->getMessage());
     }
     return $result;
@@ -443,7 +443,7 @@ class MandrillAPI implements MandrillAPIInterface {
         $result = $mandrill->inbound->addRoute($domain, $pattern, $url);
       }
     } catch (\Exception $e) {
-      drupal_set_message(t('Mandrill: %message', array('%message' => $e->getMessage())), 'error');
+      \Drupal::messenger()->addError(t('Mandrill: %message', array('%message' => $e->getMessage())));
       $this->log->error($e->getMessage());
     }
     return $result;
@@ -469,7 +469,7 @@ class MandrillAPI implements MandrillAPIInterface {
         $result = $mandrill->messages->sendTemplate($template_id, $template_content, $message);
       }
     } catch (\Exception $e) {
-      drupal_set_message(t('Mandrill: %message', array('%message' => $e->getMessage())), 'error');
+      \Drupal::messenger()->addError(t('Mandrill: %message', array('%message' => $e->getMessage())));
       $this->log->error($e->getMessage());
     }
     return $result;
@@ -512,7 +512,7 @@ class MandrillAPI implements MandrillAPIInterface {
       if (!$this->isLibraryInstalled()) {
         $msg = t('Failed to load Mandrill PHP library. Please refer to the installation requirements.');
         $this->log->error($msg);
-        drupal_set_message($msg, 'error');
+        \Drupal::messenger()->addError($msg);
         return NULL;
       }
 
@@ -521,7 +521,7 @@ class MandrillAPI implements MandrillAPIInterface {
       if (empty($api_key)) {
         $msg = t('Failed to load Mandrill API Key. Please check your Mandrill settings.');
         $this->log->error($msg);
-        drupal_set_message($msg, 'error');
+        \Drupal::messenger()->addError($msg);
         return FALSE;
       }
       // We allow the class name to be overridden, following the example of core's
diff --git a/src/Plugin/Mail/MandrillMail.php b/src/Plugin/Mail/MandrillMail.php
index e59d6ab..073ce5a 100644
--- a/src/Plugin/Mail/MandrillMail.php
+++ b/src/Plugin/Mail/MandrillMail.php
@@ -5,7 +5,6 @@ namespace Drupal\mandrill\Plugin\Mail;
 use Drupal\Core\Mail\MailInterface;
 use Drupal\Core\Link;
 use Drupal\Core\Url;
-use Drupal\Component\Utility\Unicode;
 use Drupal\Core\Mail\MailFormatHelper;
 
 /**
@@ -141,7 +140,7 @@ class MandrillMail implements MailInterface {
     $blacklisted_keys = explode(',', $this->config->get('mandrill_mail_key_blacklist'));
     $view_content = TRUE;
     foreach ($blacklisted_keys as $key) {
-      if ($message['id'] == Unicode::strtolower(trim($key))) {
+      if ($message['id'] == mb_strtolower(trim($key))) {
         $view_content = FALSE;
         break;
       }
diff --git a/src/Tests/MandrillTestCase.php b/src/Tests/MandrillTestCase.php
index f93b097..d424c70 100644
--- a/src/Tests/MandrillTestCase.php
+++ b/src/Tests/MandrillTestCase.php
@@ -8,14 +8,13 @@
 namespace Drupal\mandrill\Tests;
 
 use Drupal\mandrill\Plugin\Mail\MandrillTestMail;
-use Drupal\simpletest\WebTestBase;
-
+use \Drupal\Tests\BrowserTestBase;
 /**
  * Test core Mandrill functionality.
  *
  * @group mandrill
  */
-class MandrillTestCase extends WebTestBase {
+class MandrillTestCase extends BrowserTestBase {
 
   /**
    * Modules to enable.
