Skip to content
PHP Ecosystem
Explore

DownloadMailAction

API reference › Yii3 Debug › Action › DownloadMailAction

final readonly classYii3\Debug\Action\DownloadMailAction
ImplementsDebugActionInterface
Sourcesrc/Action/DownloadMailAction.php

Streams a captured .eml file as an attachment, selected by its bare file name.

A name carrying a path segment never resolves, so the endpoint serves only files the Mail collector stored.

MethodDescriptionDefined by
__construct()Creates the download endpoint for .eml files resolved by the mail store.DownloadMailAction
__invoke()Streams the .eml file the file query parameter names.DownloadMailAction
public function __construct(Yii3\Debug\Mail\MailFileStore $files, Psr\Http\Message\ResponseFactoryInterface $responseFactory, Psr\Http\Message\StreamFactoryInterface $streamFactory)

Creates the download endpoint for .eml files resolved by the mail store.

Parameters

ParameterTypeDescription
$filesYii3\Debug\Mail\MailFileStoreStore resolving the requested file inside the mail directory.
$responseFactoryPsr\Http\Message\ResponseFactoryInterfaceFactory building the PSR-7 response.
$streamFactoryPsr\Http\Message\StreamFactoryInterfaceFactory building the PSR-7 response body.
public function __invoke(Psr\Http\Message\ServerRequestInterface $request): Psr\Http\Message\ResponseInterface

Streams the .eml file the file query parameter names.

Parameters

ParameterTypeDescription
$requestPsr\Http\Message\ServerRequestInterfaceIncoming request carrying the query parameters.

Returns

Psr\Http\Message\ResponseInterface: message/rfc822 attachment, or a 404 response when the name is missing, unsafe, or unknown.