title: How can I render the personal contact form in node twig template?
body: <p>My website has many products posted by different people. In each node.html.twig, How can i show the personal contact form for each owner?
  I use the <a href="https://www.drupal.org/project/twig_tweak" rel="nofollow noreferrer">Twig Tweak module</a> to render form.
  Suppose I have "author" variable (<code>Drupal\user\Entity</code>) for use.</p>
  
  <p>I try in hook_preprocess_node:</p>
  
  <pre><code>function MY_thEME_preprocess_node(&amp;$variables) {
  $message = Drupal::entityTypeManager()-&gt;getStorage('contact_message')-&gt;create([
    'contact_form' =&gt; 'personal',
    'recipient' =&gt; $user-&gt;id(),
  ]);
  
  $form = \Drupal\Core\Entity\EntityFormBuilder::getForm($message);
  $form['#title'] = $this-&gt;t('Contact @username', ['@username' =&gt; $user-&gt;getDisplayName()]);
  $form['#cache']['contexts'][] = 'user.permissions';
  $variables['personal_form'] = drupal_render($form);
  }
  </code></pre>