DownloadMailAction
API reference › Yii3 Debug › Action › DownloadMailAction
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.
Methods
Section titled “Methods”| Method | Description | Defined 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 |
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”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
| Parameter | Type | Description |
|---|---|---|
$files | Yii3\ | Store resolving the requested file inside the mail directory. |
$responseFactory | Psr\ | Factory building the PSR-7 response. |
$streamFactory | Psr\ | Factory building the PSR-7 response body. |
__invoke()
Section titled “__invoke() ”public function __invoke(Psr\Http\Message\ServerRequestInterface $request): Psr\Http\Message\ResponseInterfaceStreams the .eml file the file query parameter names.
Parameters
| Parameter | Type | Description |
|---|---|---|
$request | Psr\ | Incoming 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.