Drupal is a registered trademark of Dries Buytaert
drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). eca 3.1.1 Minor update available for module eca (3.1.1). layout_paragraphs 2.1.3 Minor update available for module layout_paragraphs (2.1.3). ai 1.3.3 Minor update available for module ai (1.3.3). ai 1.2.14 Minor update available for module ai (1.2.14). node_revision_delete 2.0.3 Minor update available for module node_revision_delete (2.0.3). moderated_content_bulk_publish 2.0.52 Minor update available for module moderated_content_bulk_publish (2.0.52). klaro 3.0.10 Minor update available for module klaro (3.0.10). klaro 3.0.9 Minor update available for module klaro (3.0.9). layout_paragraphs 2.1.2 Minor update available for module layout_paragraphs (2.1.2). geofield_map 11.1.8 Minor update available for module geofield_map (11.1.8).

postoffice

17 sites Security covered
View on drupal.org

The Postoffice module sends themed emails with Symfony Mailer. This module provides a small, stable and clean API for developers to work with.

  • For details on how to use the API in a project, take a look at the guide and the examples
  • For a full description of the module, visit the project page
  • To submit bug reports and feature suggestions, or track changes, visit the issue tracker

Requirements

This module requires symfony/mailer 5 (for Drupal 9) or 6 (for Drupal 10). Optional extensions require additional composer libraries:

Installation

  • Install as you would normally install a contributed Drupal module. Visit the Installing Modules documentation page for further information.

Configuration

  • Change symfony mailer transport DSN and mail theme in Administration » Configuration » System » Postoffice settings
  • (Optional) Enable Postoffice Inline Styles module in order to inline styles from libraries referenced by templates into the generated markup.
  • (Optional) Enable Postoffice Html2Text module in order to generate a plain text part automatically.
  • (Optional) Enable Postoffice Skel module in order to wrap all HTML mails into a HTML document.
  • (Optional) Enable Postoffice Compat module and configure one or more of the included compatibility mail plugins:
    • (Optional) Send mails from the core user module using Postoffice:

      drush config:set system.mail interface.user postoffice_user_mail
    • (Optional) Send mails from the core contact module using Postoffice:

      drush config:set system.mail interface.contact postoffice_contact_mail
  • (Optional) Enable Postoffice Compat Theme module to ensure that all mail handled by core mail manager is rendered using the theme configured for Postoffice.
  • (Optional) Enable Postoffice Twig and use additional filters and functions in email twig templates:
    • postoffice_subject: Allows Twig templates to set a subject (usable as function and filter).
    • postoffice_text_body: Allows Twig templates to attach a text body part.
  • (Optional) Enable Postoffice Image and use additional filters and functions in email twig templates:
    • postoffice_image_embed: Embedds an image specified by its uri and optionally applies the given image style.
  • (Optional) Enable Postoffice File and use additional functions in email twig templates:
    • postoffice_file_attach_entity: Attaches a managed file entity.
    • postoffice_file_attach_uri: Attaches a file specified by its uri.

See Also

More contrib integration modules are developed in separate projects:

This module is geared towards developers. If it does not suit your modus operandi, please have a look at the Symfony Mailer module.

Maintainers

Current maintainers:

Activity

Total releases
3
First release
Mar 2025
Latest release
7 months ago
Release cadence
91 days
Stability
100% stable

Release Timeline

Releases

Version Type Release date
1.2.4 Stable Sep 4, 2025
1.2.3 Stable Apr 14, 2025
1.2.2 Stable Mar 7, 2025