diff --git a/email_noreply.module b/email_noreply.module
index d4934fc..58d4ec7 100644
--- a/email_noreply.module
+++ b/email_noreply.module
@@ -35,8 +35,8 @@ function email_noreply_requirements($phase) {
     $requirements['email_noreply_site_mail_unique']['severity'] = REQUIREMENT_WARNING;
     $t_args = array(
       '%name' => $account->getUsername(),
-      '@user-url' => \Drupal::url('entity.user.edit_form', array('user' => $account->id())),
-      '@config-url' => \Drupal::url('system.site_information_settings'),
+      '@user-url' => Url::fromRoute('entity.user.edit_form', array('user' => $account->id()))->toString(),
+      '@config-url' => Url::fromRoute('system.site_information_settings')->toString(),
     );
     $requirements['email_noreply_site_mail_unique']['description'] = t('The
       user %name has the same e-mail address as the site. Please
