diff --git a/uc_stock/config/uc_stock.mail.yml b/uc_stock/config/uc_stock.mail.yml
new file mode 100644
index 0000000..1a33c99
--- /dev/null
+++ b/uc_stock/config/uc_stock.mail.yml
@@ -0,0 +1,4 @@
+threshold_notification:
+  body: 'This message has been sent to let you know that the stock level for "[node:title]" with SKU [uc_stock:model] has reached [uc_stock:level]. There may not be enough units in stock to fulfill order #[uc_order:link].'
+  subject: '[store:name]: Stock threshold limit reached for [node:title]'
+langcode: en
diff --git a/uc_stock/config/uc_stock.settings.yml b/uc_stock/config/uc_stock.settings.yml
new file mode 100644
index 0000000..de0f2cc
--- /dev/null
+++ b/uc_stock/config/uc_stock.settings.yml
@@ -0,0 +1,2 @@
+notify: false
+recipients: '[store:email]'
diff --git a/uc_stock/lib/Drupal/uc_stock/Form/StockSettingsForm.php b/uc_stock/lib/Drupal/uc_stock/Form/StockSettingsForm.php
index 7ac4696..f51cc8d 100644
--- a/uc_stock/lib/Drupal/uc_stock/Form/StockSettingsForm.php
+++ b/uc_stock/lib/Drupal/uc_stock/Form/StockSettingsForm.php
@@ -25,29 +25,32 @@ class StockSettingsForm extends ConfigFormBase {
    * {@inheritdoc}
    */
   public function buildForm(array $form, array &$form_state) {
+    $config = $this->config('uc_stock.settings');
+    $mail = $this->config('uc_stock.mail');
+
     $form['uc_stock_threshold_notification'] = array(
       '#type' => 'checkbox',
       '#title' => t('Send email notification when stock level reaches its threshold value'),
-      '#default_value' => variable_get('uc_stock_threshold_notification', FALSE),
+      '#default_value' => $config->get('notify'),
     );
 
     $form['uc_stock_threshold_notification_recipients'] = array(
       '#type' => 'textfield',
       '#title' => t('Notification recipients'),
-      '#default_value' => variable_get('uc_stock_threshold_notification_recipients', uc_store_email()),
+      '#default_value' => $config->get('recipients'),
       '#description' => t('The list of comma-separated email addresses that will receive the notification.'),
     );
 
     $form['uc_stock_threshold_notification_subject'] = array(
       '#type' => 'textfield',
       '#title' => t('Message subject'),
-      '#default_value' => variable_get('uc_stock_threshold_notification_subject', uc_get_message('uc_stock_threshold_notification_subject')),
+      '#default_value' => $mail->get('threshold_notification.subject'),
     );
 
     $form['uc_stock_threshold_notification_message'] = array(
       '#type' => 'textarea',
       '#title' => t('Message text'),
-      '#default_value' => variable_get('uc_stock_threshold_notification_message', uc_get_message('uc_stock_threshold_notification_message')),
+      '#default_value' => $mail->get('threshold_notification.body'),
       '#description' => t('The message the user receives when the stock level reaches its threshold value.'),
       '#rows' => 10,
     );
@@ -65,10 +68,15 @@ class StockSettingsForm extends ConfigFormBase {
    * {@inheritdoc}
    */
   public function submitForm(array &$form, array &$form_state) {
-    variable_set('uc_stock_threshold_notification', $form_state['values']['uc_stock_threshold_notification']);
-    variable_set('uc_stock_threshold_notification_recipients', $form_state['values']['uc_stock_threshold_notification_recipients']);
-    variable_set('uc_stock_threshold_notification_subject', $form_state['values']['uc_stock_threshold_notification_subject']);
-    variable_set('uc_stock_threshold_notification_message', $form_state['values']['uc_stock_threshold_notification_message']);
+    $this->config('uc_stock.settings')
+      ->set('notify', $form_state['values']['uc_stock_threshold_notification'])
+      ->set('recipients', $form_state['values']['uc_stock_threshold_notification_recipients'])
+      ->save();
+
+    $this->config('uc_stock.mail')
+      ->set('threshold_notification.subject', $form_state['values']['uc_stock_threshold_notification_subject'])
+      ->set('threshold_notification.body', $form_state['values']['uc_stock_threshold_notification_message'])
+      ->save();
 
     parent::submitForm($form, $form_state);
   }
diff --git a/uc_stock/lib/Drupal/uc_stock/Tests/StockTest.php b/uc_stock/lib/Drupal/uc_stock/Tests/StockTest.php
index 4f539e6..ce41835 100644
--- a/uc_stock/lib/Drupal/uc_stock/Tests/StockTest.php
+++ b/uc_stock/lib/Drupal/uc_stock/Tests/StockTest.php
@@ -107,6 +107,7 @@ class StockTest extends UbercartTestBase {
 
     $mail = $this->drupalGetMails(array('id' => 'uc_stock_threshold'));
     $mail = array_pop($mail);
+    $this->assertEqual($mail['to'], uc_store_email(), 'Threshold mail recipient is correct.');
     $this->assertTrue(strpos($mail['subject'], 'Stock threshold limit reached') !== FALSE, 'Threshold mail subject is correct.');
     $this->assertTrue(strpos($mail['body'], $this->product->label()) !== FALSE, 'Mail body contains product title.');
     $this->assertTrue(strpos($mail['body'], $this->product->model) !== FALSE, 'Mail body contains SKU.');
diff --git a/uc_stock/uc_stock.module b/uc_stock/uc_stock.module
index c975ee5..3402e9a 100644
--- a/uc_stock/uc_stock.module
+++ b/uc_stock/uc_stock.module
@@ -84,15 +84,6 @@ function uc_stock_mail($key, &$message, $params) {
 }
 
 /**
- * Implements hook_uc_message().
- */
-function uc_stock_uc_message() {
-  $messages['uc_stock_threshold_notification_subject'] = t('[store:name]: Stock threshold limit reached');
-  $messages['uc_stock_threshold_notification_message'] = t('This message has been sent to let you know that the stock level for "[node:title]" with SKU [uc_stock:model] has reached [uc_stock:level]. There may not be enough units in stock to fulfill order #[uc_order:link].');
-  return $messages;
-}
-
-/**
  * Adjusts the product stock level by a set amount.
  *
  * @param $sku
@@ -185,15 +176,16 @@ function _uc_stock_send_mail($order, $node, $stock) {
   $account = $order->getUser();
   $token_filters = array('uc_order' => $order, 'user' => $account, 'uc_stock' => $stock, 'node' => $node);
 
-  $to = variable_get('uc_stock_threshold_notification_recipients', uc_store_email());
+  $to = \Drupal::config('uc_stock.settings')->get('recipients');
+  $to = $token_service->replace($to, $token_filters);
   $to = explode(',', $to);
 
   $from = uc_store_email_from();
 
-  $subject = variable_get('uc_stock_threshold_notification_subject', uc_get_message('uc_stock_threshold_notification_subject'));
+  $mail_config = \Drupal::config('uc_stock.mail');
+  $subject = $mail_config->get('threshold_notification.subject');
   $subject = $token_service->replace($subject, $token_filters);
-
-  $body = variable_get('uc_stock_threshold_notification_message', uc_get_message('uc_stock_threshold_notification_message'));
+  $body = $mail_config->get('threshold_notification.body');
   $body = $token_service->replace($body, $token_filters);
 
   // Send to each recipient.
@@ -245,7 +237,7 @@ function uc_stock_adjust_product_stock($product, $key, $order) {
   $stock = db_query("SELECT * FROM {uc_product_stock} WHERE sku = :sku", array(':sku' => $product->model->value))->fetchObject();
 
   // Should we notify?
-  if (variable_get('uc_stock_threshold_notification', FALSE) && $stock->stock <= $stock->threshold) {
+  if (\Drupal::config('uc_stock.settings')->get('notify') && $stock->stock <= $stock->threshold) {
     $node = node_load($product->nid->value);
     _uc_stock_send_mail($order, $node, $stock);
   }
