Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Usage Milestone: Google Analytics Module google_analytics crossed 1,000 active installs. Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Release: GraphQL Compose Codegen 1.1.2 Minor update available for module graphql_compose_codegen (1.1.2). Release: Mapy.com 1.1.3 Minor update available for module mapycom (1.1.3). Release: Ckeditor5 entity browser 3.0.3 Minor update available for module ckeditor5_entity_browser (3.0.3). Release: Ckeditor5 entity browser 3.0.1 Minor update available for module ckeditor5_entity_browser (3.0.1). Release: Ckeditor5 entity browser 3.0.2 Minor update available for module ckeditor5_entity_browser (3.0.2). Release: Teamleader Integration 4.0.2 Minor update available for module teamleader (4.0.2). Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Postoffice

16 sites Security covered Drupal 10–11
View on drupal.org

The Postoffice module provides a clean API for developers to send themed emails using Symfony Mailer. It offers optional extensions to enhance email generation and integration with various Drupal features.

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:

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

2 tracked projects depend on this one

Activity

Tracked releases
6
Tracked since
Sep 2024
Latest release
11 months ago
Releases (12 mo)
1 ▼ from 5
Maintenance
Slowing

Release Timeline

Releases

Version Type Core Release date
1.2.4 Stable 10–11 Sep 4, 2025
1.2.3 Stable 10–11 Apr 14, 2025
1.2.2 Stable 10–11 Mar 7, 2025
1.2.1 Stable 10–11 Sep 27, 2024
1.2.0 Stable 10–11 Sep 27, 2024
1.2.x-dev Dev 10–11 Sep 27, 2024