How to generate a preview URL in Twig
I figured this out:
{% set token = craft.app.tokens.createToken([&quot;preview/preview&quot;, {&quot;elementType&quot;: &quot;craft\\elements\\Entry&quot;, &quot;sourceId&quot;: 123, &quot;siteId&quot;: 1}]) %}
&lt;a href=&quot;{{ element.url }}?token={{ token }}&quot;&gt;Preview&lt;/a&gt;

Make sure sourceId and siteId are set correctly.