OneTimePasswordEmail Format: HTML

Hi
Is there any reason why lang\OneTimePasswordEmail.en-US.php template does not support HTML formatting?

Subject: Your One Time Password for Login
From:

in 2024

Subject: Your One Time Password for Login
From: <?= $From ?>
To: <?= $To ?>
Cc:
Bcc:
Format: HTML

thanks

By default Symfony notifier only uses text message for simple email like sending OTP, but you can use MessageEvent to change the email content yourself, you may get the Email object by $event->getMessage() and then manipulate.

what about if i am using “Use PHPMailer” option? this is still not sending as html, this correct?

There is no option to send HTML with OneTimePasswordEmail.xxx.php.

sorry where do i add the message event?

You may use Global Code.

how do i go about moving the data from [“text”:“Symfony\Component\Mime\Email”:private]=> string(112) "Please …
to
[“html”:“Symfony\Component\Mime\Email”:private]=> NULL
which is guessing is where is needs to be?

Follow the link, check the source and see what methods you can use.

thanks i can get the text
$TextBody = $event->getMessage()->getTextBody;
if i try and set the html body,with
$event->getMessage()->getHtmlBody = $TextBody;
$event->getMessage()->getTextBody = Null;
it is still not in html

any ideas?
thanks

As suggested check the source and see what methods you can use.

Added to Global Code

// MessageEvent
AddListener(\Symfony\Component\Mailer\Event\MessageEvent::class, function (\Symfony\Component\Mailer\Event\MessageEvent $event): void {
	$event->getMessage()->html($event->getMessage()->getTextBody());
	 // Stop the message from being sent
         //$event->reject();
});