-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] Allow editors to choose whether attachments are sent
- Loading branch information
Showing
9 changed files
with
151 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace In2code\Powermail\UserFunc; | ||
|
||
use TYPO3\CMS\Core\Configuration\Features; | ||
use TYPO3\CMS\Core\Utility\GeneralUtility; | ||
|
||
class TestForFeature | ||
{ | ||
public function isFeatureEnabled(array $arguments = []): bool | ||
{ | ||
$features = GeneralUtility::makeInstance(Features::class); | ||
if ($features->isFeatureEnabled($arguments['conditionParameters'][0])) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
TCEFORM { | ||
tt_content { | ||
pi_flexform { | ||
powermail_pi1 { | ||
sender { | ||
settings\.flexform\.sender\.attachment { | ||
disabled = 1 | ||
} | ||
} | ||
receiver { | ||
settings\.flexform\.receiver\.attachment { | ||
disabled = 1 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
57 changes: 57 additions & 0 deletions
57
Documentation/ForAdministrators/BestPractice/SendAttachments.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# How to send attachments | ||
|
||
## Defined by TypoScript | ||
|
||
In versions < 12.5 it was only possible to define, whether attachments are sent or not, via TypoScript. This setting | ||
was used for all forms and plugins (unless you used conditions or set the value in the database). | ||
|
||
```typo3_typoscript | ||
plugin.tx_powermail.settings.setup { | ||
reciever { | ||
attachment = {$plugin.tx_powermail.settings.receiver.attachment} | ||
} | ||
sender { | ||
attachment = {$plugin.tx_powermail.settings.sender.attachment} | ||
} | ||
} | ||
``` | ||
|
||
## Defined by editors | ||
|
||
Since version 12.5 it is possible, that editors define, whether attachments should be sent or not. This feature is | ||
"hidden" behind a feature toggle and restrictive page tsconfig settings. | ||
|
||
### Steps for activation | ||
|
||
1) Activate the feature toggle in site settings | ||
|
||
```php | ||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['features']['powermailEditorsAreAllowedToSendAttachments'] = true; | ||
``` | ||
|
||
2) Activate the fields in PageTSconfig | ||
|
||
Due to security reasons these fields are hidden by default, so that the admin must take an additional step. Editors | ||
should not get more permissions, than necessary by a feature release. ;-) | ||
|
||
```typo3_typoscript | ||
TCEFORM { | ||
tt_content { | ||
pi_flexform { | ||
powermail_pi1 { | ||
sender { | ||
settings\.flexform\.sender\.attachment { | ||
disabled = 0 | ||
} | ||
} | ||
receiver { | ||
settings\.flexform\.receiver\.attachment { | ||
disabled = 0 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters