Skip to content

Instantly share code, notes, and snippets.

@dbu
dbu / OAuthEsmtpTransportFactoryDecorator.php
Last active December 18, 2025 10:45
Send emails with Symfony Mailer through Outlook / office365 with OAuth
<?php
declare(strict_types=1);
namespace App\Infrastructure\Email;
use Symfony\Component\Mailer\Transport\Dsn;
use Symfony\Component\Mailer\Transport\Smtp\Auth\AuthenticatorInterface;
use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport;
use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransportFactory;
@dbu
dbu / README.md
Created January 14, 2026 13:43
Configure commonmark extensions in twig extra bundle

It is actually possible to include and configure commonmark extensions when using the markdown features of Twig Extra Bundle.

The documentation at https://twig.symfony.com/doc/3.x/filters/markdown_to_html.html does not explain how, so let me show it here.

We need to define a tagged service for the extension and we need to specify the configuration.

⚠️ beware, there is no validation of configuration, neither in Twig Extra Bundle nor in Commonmark that receives the configuration. If your configuration is in the wrong place or has typos, it will simply not be taken into account.