02.04.2026 | Michael Ebert

Set a custom theme to be used by Symfony Mailer

symfony_mailer.mailer_policy._.yml
configuration:
  email_theme:
    theme: my_custom_theme

Prerequisite:

Installed and enabled the Symfony Mailer module.

Issue:

You have multiple themes enabled in your drupal page and need to select the theme that includes custom templates for send emails.

Solution:

Configure Symfony Mailer to use templates coming from your custom theme.

Go to `/admin/config/system/mailer` and edit the policy. There you can switch the theme that is used for sending your e-mails.

Symfony Mailer Policy Configuration

Weitere DevBits

13.11.2025 | Peter Majmesku

Autowire services with the Autowire attribute in Drupal

Example.php
<?php

declare(strict_types=1);

namespace Drupal\my_module;

use Drupal\Core\Session\AccountInterface;
use Symfony\Component\DependencyInjection\Attribute\Autowire;

class Example {

  public function __construct(
    #[Autowire(service: 'current_user')]
    private readonly AccountInterface $currentUser,
  ) {
  }

  public function getCurrentUser(): AccountInterface {
    return $this->currentUser;
  }

}

my_module.services.yml
services:
  my_module.example:
    class: Drupal\my_module\Service\Example
    autowire: true
  Drupal\my_module\Service\Example: '@my_module.example'

php
services
yml / yaml
19.03.2026 | Peter Gerken

Block raw network access for a container

docker-compose.offline.yml
services:
  web:
    cap_drop:
      - NET_RAW
yml / yaml
local development
docker
copy-paste