Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Postoffice

Security covered Under active development 96 sites

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:

Drupal 10–11

Ask your assistant about Postoffice

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

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
12
Tracked since
Feb 2023
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 3
Maintenance
Dormant

Release Timeline

Releases

Version Type Core PHP Release date
1.1.2 Stable 9–10 Mar 16, 2023
1.1.1 Stable 9–10 Feb 22, 2023