Skip to content

Commit

Permalink
[TASK] View notice about required configuration in backend module
Browse files Browse the repository at this point in the history
  • Loading branch information
eliashaeussler committed Mar 7, 2024
1 parent a2fa176 commit fa7d1d7
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 4 deletions.
1 change: 1 addition & 0 deletions Classes/Controller/MailqueueModuleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public function __invoke(Message\ServerRequestInterface $request): Message\Respo
} else {
$templateVariables = [
'unsupportedTransport' => $this->getTransportFromMailConfiguration(),
'typo3Version' => $this->typo3Version->getMajorVersion(),
];
}

Expand Down
10 changes: 10 additions & 0 deletions Resources/Private/Language/locallang.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,16 @@
<source>The mail was successfully sent.</source>
</trans-unit>

<trans-unit id="unsupportedTransport.docs.text">
<source>Read the %s to learn more about mail spoolers in TYPO3.</source>
</trans-unit>
<trans-unit id="unsupportedTransport.docs.linkText">
<source>official documentation</source>
</trans-unit>
<trans-unit id="unsupportedTransport.example.header">
<source>Example configuration</source>
</trans-unit>

<trans-unit id="modal.failureDetails.header">
<source>Transport failure details</source>
</trans-unit>
Expand Down
50 changes: 50 additions & 0 deletions Resources/Private/Partials/List/UnsupportedTransport.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
xmlns:c="http://typo3.org/ns/TYPO3/CMS/Core/ViewHelpers"
data-namespace-typo3-fluid="true">

<f:be.infobox state="2"
title="{f:translate(key: 'alert.unsupportedTransport.title', extensionName: 'Mailqueue')}"
message="{f:translate(key: 'alert.unsupportedTransport.message', arguments: '{0: transport}', extensionName: 'Mailqueue')}"
/>

<f:variable name="docsLink"><f:spaceless>
<a href="https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/Mail/Index.html#spooling"
target="_blank"
rel="noreferrer"
>{f:translate(key: 'unsupportedTransport.docs.linkText', extensionName: 'Mailqueue')}</a>
</f:spaceless></f:variable>

<p>
{f:translate(key: 'unsupportedTransport.docs.text', extensionName: 'Mailqueue', arguments: '{0: docsLink}') -> f:format.raw()}
</p>

<div class="card">
<div class="card-header">
<div class="card-icon">
<c:icon identifier="actions-file-edit" />
</div>
<div class="card-header-body">
<h2 class="card-title">{f:translate(key: 'unsupportedTransport.example.header', extensionName: 'Mailqueue')}</h2>
</div>
</div>
<div class="card-body">
<pre><code><f:spaceless>
$GLOBALS['TYPO3_CONF_VARS']['MAIL']['transport_spool_type'] = 'file';
$GLOBALS['TYPO3_CONF_VARS']['MAIL']['transport_spool_filepath'] = '/path/to/mailqueue';
</f:spaceless></code></pre>
</div>
<div class="card-footer">
<f:if condition="{typo3Version} >= 12">
<f:then>
<code>config/system/additional.php</code>
</f:then>
<f:else>
<f:comment><!-- @todo Remove once support for TYPO3 v11 is dropped --></f:comment>
<code>typo3conf/AdditionalConfiguration.php</code>
</f:else>
</f:if>
</div>
</div>


</html>
8 changes: 4 additions & 4 deletions Resources/Private/Templates/List.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ <h1>{f:translate(key: 'header.list', extensionName: 'Mailqueue')}</h1>

<f:if condition="{unsupportedTransport}">
<f:then>
<f:be.infobox state="2"
title="{f:translate(key: 'alert.unsupportedTransport.title', extensionName: 'Mailqueue')}"
message="{f:translate(key: 'alert.unsupportedTransport.message', arguments: '{0: unsupportedTransport}', extensionName: 'Mailqueue')}"
/>
<f:render partial="List/UnsupportedTransport" arguments="{
transport: unsupportedTransport,
typo3Version: typo3Version
}" />
</f:then>
<f:else>
<f:render partial="List/Queue" arguments="{
Expand Down

0 comments on commit fa7d1d7

Please sign in to comment.