maximaster/file-mailer-transport

Saves served emails as files

0.0.1 2021-03-01 10:58 UTC

This package is auto-updated.

Last update: 2024-04-29 04:21:30 UTC


README

Do you want to save your symfony/mailer emails as files (e.g. .EML)?

You've just found the right package!

Usage

composer require maximaster/file-mailer-transport

services.yaml

    Maximaster\FileMailerTransport\TransportFactory:
        arguments:
            $projectDir: '%kernel.project_dir%'

    mailer.default_transport:
        class: Symfony\Component\Mailer\Transport\TransportInterface
        factory: '@Maximaster\FileMailerTransport\TransportFactory'
        arguments:
            $dsn: '%env(MAILER_DSN)%'

.env

MAILER_DSN=file:///upload/emails/%Y/%m/%d/%T_@hash.eml

Options

  • new_directory_mode - with which rights new directory will be created
  • hash_algo - controls how @hash replacement is calculated
  • path_renderer - callback which is supposed to render a real file path from a path template