How do I programmatically render a form, other than the default form? In a preprocess function we can use this code to render the default form.

$default_form = \Drupal::config('contact.settings')-&gt;get('default_form');
$entity = \Drupal::entityManager()-&gt;getStorage('contact_form')-&gt;load($default_form);

$message = \Drupal::entityManager()
   -&gt;getStorage('contact_message')
   -&gt;create(array('contact_form' =&gt; $entity-&gt;id(),
));

$form = \Drupal::service('entity.form_builder')-&gt;getForm($message);


How do we render another form? I have tried $my_form = \Drupal::config('contact.settings')-&gt;get('my_form_id'); without success.
A contact form?

your_form_id is the form, you don't have to load a setting for that. If you know what contact form you want to display, just replace $default_form with your form_id and it should work.