I found a problem while sending confirmation e-mails. My HTML was escaped in translation strings. This fixed it.

Before:

$message['body'][] = '<p>' . t('Please confirm in order to finalize your registration for <a href="@url">@registration</a>', ['@registration' => $params['entity']->label(), '@url' => $path]) . '</a>.</p>';

After:

// on top of file add:
use Drupal\Core\Mail\MailFormatHelper;

// In your hook_mail() 
$body = '<p>' . t('Please confirm in order to finalize your registration for <a href="@url">@registration</a>', ['@registration' => $params['entity']->label(), '@url' => $path]) . '</a>.</p>';

$message['body'][] = MailFormatHelper::wrapMail($body);