diff --git a/src/Form/RerouteEmailSettings.php b/src/Form/RerouteEmailSettings.php
index ff1304f..ae8201e 100644
--- a/src/Form/RerouteEmailSettings.php
+++ b/src/Form/RerouteEmailSettings.php
@@ -97,7 +97,7 @@ class RerouteEmailSettings extends ConfigFormBase {
       $addresslist = preg_split(REROUTE_EMAIL_EMAIL_SPLIT_RE, $form_state->getValue(['reroute_email_address']), -1, PREG_SPLIT_NO_EMPTY);
       foreach ($addresslist as $address) {
         if (!valid_email_address($address)) {
-          $form_state->setErrorByName('reroute_email_address', t('@address is not a valid email address', [
+          $form_state->setErrorByName('reroute_email_address', $this->t('@address is not a valid email address', [
             '@address' => $address
           ]));
         }
diff --git a/src/Form/RerouteEmailTestEmailForm.php b/src/Form/RerouteEmailTestEmailForm.php
index 81c3609..7eeb77c 100644
--- a/src/Form/RerouteEmailTestEmailForm.php
+++ b/src/Form/RerouteEmailTestEmailForm.php
@@ -17,33 +17,33 @@ class RerouteEmailTestEmailForm extends FormBase {
     return [
       'addresses' => [
         '#type' => 'fieldset',
-        '#description' => t('Email addresses are not validated: any valid or invalid email address format could be submitted.'),
+        '#description' => $this->t('Email addresses are not validated: any valid or invalid email address format could be submitted.'),
         'to' => [
           '#type' => 'textfield',
-          '#title' => t('To'),
+          '#title' => $this->t('To'),
           '#required' => TRUE,
         ],
         'cc' => [
           '#type' => 'textfield',
-          '#title' => t('Cc'),
+          '#title' => $this->t('Cc'),
         ],
         'bcc' => [
           '#type' => 'textfield',
-          '#title' => t('Bcc'),
+          '#title' => $this->t('Bcc'),
         ],
       ],
       'subject' => [
         '#type' => 'textfield',
-        '#title' => t('Subject'),
-        '#default_value' => t('Reroute Email Test'),
+        '#title' => $this->t('Subject'),
+        '#default_value' => $this->t('Reroute Email Test'),
       ],
       'body' => [
         '#type' => 'textarea',
-        '#title' => t('Body'),
+        '#title' => $this->t('Body'),
       ],
       'submit' => [
         '#type' => 'submit',
-        '#value' => t('Send email'),
+        '#value' => $this->t('Send email'),
       ],
     ];
   }
@@ -60,7 +60,7 @@ class RerouteEmailTestEmailForm extends FormBase {
     $message =  \Drupal::service('plugin.manager.mail')->mail('reroute_email', 'test_email_form', $to, $langcode, $params, $from);
 
     if (!empty($message['result'])) {
-      drupal_set_message(t("Test email submitted for delivery from test form."));
+      drupal_set_message($this->t("Test email submitted for delivery from test form."));
     }
   }
 
diff --git a/src/RerouteEmailTestBase.php b/src/RerouteEmailTestBase.php
index d30ed3b..1cbc03b 100644
--- a/src/RerouteEmailTestBase.php
+++ b/src/RerouteEmailTestBase.php
@@ -77,8 +77,8 @@ class RerouteEmailTestBase extends WebTestBase  {
       'reroute_email_enable_message' => $reroute_email_enable_message,
     );
     // Submit Reroute Email Settings form and check if it was successful.
-    $this->drupalPostForm("admin/config/development/reroute_email", $post, t('Save configuration'));
-    $this->assertText(t("The configuration options have been saved."));
+    $this->drupalPostForm("admin/config/development/reroute_email", $post, $this->t('Save configuration'));
+    $this->assertText($this->t("The configuration options have been saved."));
   }
 
   /**
@@ -98,10 +98,10 @@ class RerouteEmailTestBase extends WebTestBase  {
       $original_destination = $this->originalDestination;
     }
     // Search in $mailbody for "Originally to: $original_destination".
-    $search_for = t("Originally to: @to", array('@to' => $original_destination));
+    $search_for = $this->t("Originally to: @to", array('@to' => $original_destination));
     $has_info = preg_match("/$search_for/", $mail_body);
     // Asserts whether searched text was found.
     $this->assertTrue($has_info, $message);
-    $this->verbose(t('Email body was: <pre>@mail_body</pre>', array('@mail_body' => $mail_body)));
+    $this->verbose($this->t('Email body was: <pre>@mail_body</pre>', array('@mail_body' => $mail_body)));
   }
 }
