Use Twig to render HTML email body for SwiftMailer
Sure, that's possible. It works exactly as if you would render something for the page.

After preparing your render array like you always do, all you need to do is call the renderPlain() method of the renderer service, that gives you a string (Actually, a Markup object containing a string).

contact_mail() does exactly that, the relevant part:

$build = entity_view($contact_message, 'mail');
$message['body'][] = \Drupal::service('renderer')-&gt;renderPlain($build);


PS: The fact it is a Markup object is important, do not try to cast it to a string.