Use Token in contact form as default value
Usually this is done in hook_form_contact_site_form_alter, like this:

function YOUR_MODULE_form_contact_site_form_alter(&amp;$form, &amp;$form_state) {
      $args = \Drupal::request()-&gt;query-&gt;all();
      $form['subject']['#default_value'] = $args['foo'];
}