Skip to content

Commit 1b80be1

Browse files
committed
Merge branch 'release/7.4.0'
2 parents efe574f + 0ab6f4e commit 1b80be1

File tree

13 files changed

+116
-25
lines changed

13 files changed

+116
-25
lines changed

Classes/Controller/FormController.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ public function optinConfirmAction(int $mail, string $hash)
296296
$mail->setHidden(false);
297297
$this->mailRepository->update($mail);
298298
$this->persistenceManager->persistAll();
299+
$this->signalDispatch(__CLASS__, __FUNCTION__ . 'AfterPersist', [$mail, $hash, $this]);
299300

300301
$this->forward('create', null, null, ['mail' => $mail, 'hash' => $hash]);
301302
}

Classes/Domain/Model/Field.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ class Field extends AbstractEntity
5454
protected $path = '';
5555

5656
/**
57-
* @var string
57+
* @var int
5858
*/
59-
protected $contentElement = '';
59+
protected $contentElement = 0;
6060

6161
/**
6262
* @var string
@@ -329,7 +329,7 @@ public function setPath($path)
329329
/**
330330
* Returns the contentElement
331331
*
332-
* @return string $contentElement
332+
* @return int $contentElement
333333
*/
334334
public function getContentElement()
335335
{
@@ -339,12 +339,12 @@ public function getContentElement()
339339
/**
340340
* Sets the contentElement
341341
*
342-
* @param string $contentElement
342+
* @param int $contentElement
343343
* @return void
344344
*/
345345
public function setContentElement($contentElement)
346346
{
347-
$this->contentElement = $contentElement;
347+
$this->contentElement = (int) $contentElement;
348348
}
349349

350350
/**

Classes/Domain/Service/Mail/SendMailService.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,19 @@ protected function prepareAndSend(array $email)
126126
$message = $this->addPlainBody($message, $email);
127127
$message = $this->addSenderHeader($message);
128128

129+
$email['send'] = true;
129130
$signalArguments = [$message, &$email, $this];
130131
$this->signalDispatch(__CLASS__, 'sendTemplateEmailBeforeSend', $signalArguments);
132+
if (!$email['send']) {
133+
if ($this->settings['debug']['mail']) {
134+
$logger = ObjectUtility::getLogger(__CLASS__);
135+
$logger->info(
136+
'Mail was not sent: the signal has aborted sending. Email array after signal execution:',
137+
[$email]
138+
);
139+
}
140+
return false;
141+
}
131142

132143
$message->send();
133144
$this->updateMail($email);

Classes/Domain/Validator/SpamShield/LinkMethod.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function spamCheck()
1717
{
1818
$linkAmount = 0;
1919
foreach ($this->mail->getAnswers() as $answer) {
20-
if (is_array($answer->getValue())) {
20+
if (!is_string($answer->getValue())) {
2121
continue;
2222
}
2323
preg_match_all('@http://|https://|ftp://@', $answer->getValue(), $result);

Classes/Domain/Validator/UploadValidator.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
namespace In2code\Powermail\Domain\Validator;
44

55
use In2code\Powermail\Domain\Model\File;
6-
use In2code\Powermail\Domain\Model\Form;
76
use In2code\Powermail\Domain\Repository\FormRepository;
7+
use In2code\Powermail\Domain\Repository\MailRepository;
88
use In2code\Powermail\Domain\Service\UploadService;
99
use In2code\Powermail\Utility\ObjectUtility;
1010
use TYPO3\CMS\Core\Utility\GeneralUtility;
11+
use TYPO3\CMS\Extbase\SignalSlot\Exception\InvalidSlotException;
12+
use TYPO3\CMS\Extbase\SignalSlot\Exception\InvalidSlotReturnException;
1113

1214
/**
1315
* Class for uploading files and check if they are valid
@@ -20,6 +22,8 @@ class UploadValidator extends AbstractValidator
2022
*
2123
* @param \In2code\Powermail\Domain\Model\Mail $mail
2224
* @return bool
25+
* @throws InvalidSlotException
26+
* @throws InvalidSlotReturnException
2327
*/
2428
public function isValid($mail)
2529
{
@@ -52,8 +56,13 @@ protected function formHasUploadFields()
5256
{
5357
$arguments = GeneralUtility::_GP('tx_powermail_pi1');
5458
$formRepository = ObjectUtility::getObjectManager()->get(FormRepository::class);
55-
/** @var Form $form */
56-
$form = $formRepository->findByUid((int)$arguments['mail']['form']);
59+
if (is_string($arguments['mail'])) {
60+
$mailRepository = ObjectUtility::getObjectManager()->get(MailRepository::class);
61+
$mail = $mailRepository->findByUid((int)$arguments['mail']);
62+
$form = $formRepository->findByUid((int)$mail->getForm()->getUid());
63+
} else {
64+
$form = $formRepository->findByUid((int)$arguments['mail']['form']);
65+
}
5766
return $form->hasUploadField();
5867
}
5968

Documentation/Changelog/Index.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,21 @@ All changes are documented on https://docs.typo3.org/typo3cms/extensions/powerma
1717
:Changes:
1818
Release Description
1919

20+
- :Version:
21+
7.4.0
22+
:Date:
23+
2019-08-27
24+
:Changes:
25+
26+
* Feature: Allow aborting of the email sending process via signal
27+
* Feature: Add a new signal optinConfirmActionAfterPersist
28+
* Feature: Use new documentation rendering
29+
* Bugfix: Spamcheck fix while searching for links in answers with non-string values
30+
* Bugfix: Fix double opt-in with an upload field
31+
* Task: Change German wording for optin mails
32+
* Task: Small cleanups
33+
* Task: Update documentation
34+
2035
- :Version:
2136
7.3.1
2237
:Date:

Documentation/ForAdministrators/BestPractice/Debug/Index.rst

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
Debug Powermail
66
---------------
77

8-
With TypoScript it's possible to enable some Devlog Output,
8+
With TypoScript it's possible to enable some logging Output,
99
which could help you to fix problems or a misconfiguration.
1010

11-
You need an additional extension to show the debug output (e.g. "devlog").
11+
The logging output will not be saved by default. You need to enable it (see example below).
12+
https://docs.typo3.org/typo3cms/CoreApiReference/ApiOverview/Logging/Index.html
1213

1314
Comprehensive Example
1415
"""""""""""""""""""""
@@ -25,6 +26,18 @@ Comprehensive Example
2526
}
2627
}
2728
29+
.. code-block:: php
30+
$GLOBALS['TYPO3_CONF_VARS']['LOG']['In2code']['Powermail']['writerConfiguration'] = [
31+
// configuration for WARNING severity, including all
32+
// levels with higher severity (ERROR, CRITICAL, EMERGENCY)
33+
\TYPO3\CMS\Core\Log\LogLevel::DEBUG => [
34+
// add a SyslogWriter
35+
'TYPO3\\CMS\\Core\\Log\\Writer\\FileWriter' => [
36+
'logFile' => 'typo3temp/logs/powermail.log',
37+
],
38+
],
39+
];
40+
2841
2942
Configuration
3043
^^^^^^^^^^^^^

Documentation/Includes.txt

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,31 @@
1-
2-
31
.. ==================================================
42
.. FOR YOUR INFORMATION
53
.. --------------------------------------------------
64
.. -*- coding: utf-8 -*- with BOM.
75

6+
.. ---------
7+
.. textroles
8+
.. ---------
89

10+
.. role:: aspect (emphasis)
11+
.. role:: html(code)
12+
.. role:: js(code)
13+
.. role:: php(code)
14+
.. role:: rst(code)
15+
.. role:: sep (strong)
16+
.. role:: typoscript(code)
917

10-
.. ==================================================
11-
.. DEFINE SOME TEXTROLES
12-
.. --------------------------------------------------
13-
.. role:: underline
14-
.. role:: typoscript(code)
15-
.. role:: ts(typoscript)
16-
:class: typoscript
17-
.. role:: php(code)
18+
.. role:: ts(typoscript)
19+
:class: typoscript
20+
21+
.. role:: yaml(code)
22+
23+
.. default-role:: code
24+
25+
.. ---------
26+
.. highlight
27+
.. ---------
28+
29+
.. By default, code blocks are php
30+
31+
.. highlight:: php

Documentation/Settings.cfg

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Sphinx setup file
2+
#
3+
# Template see https://docs.typo3.org/m/typo3/docs-how-to-document/master/en-us/GeneralConventions/DirectoryFilenames.html#example
4+
5+
[general]
6+
project = powermail
7+
release = 7.4.0
8+
copyright = since 2006 by Alexander Kellner
9+
10+
[html_theme_options]
11+
github_branch = develop
12+
github_repository = einpraegsam/powermail
13+
14+
project_contact = https://github.com/einpraegsam/powermail
15+
project_discussions =
16+
project_home = https://github.com/einpraegsam/powermail
17+
project_issues = https://github.com/einpraegsam/powermail/issues
18+
project_repository = https://github.com/einpraegsam/powermail
19+
20+
[intersphinx_mapping]
21+
t3install = https://docs.typo3.org/m/typo3/guide-installation/master/en-us/
22+
t3tca = https://docs.typo3.org/m/typo3/reference-tca/master/en-us/
23+
t3tsconfig = https://docs.typo3.org/m/typo3/reference-tsconfig/master/en-us/
24+
t3tsref = https://docs.typo3.org/m/typo3/reference-typoscript/master/en-us/
25+
26+
[extlinks]
27+
issue = https://github.com/einpraegsam/powermail/issues/%s | Issue #

Documentation/Settings.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ conf.py:
77
copyright: 2019
88
project: Powermail
99
version: 7
10-
release: 7.3
10+
release: 7.4
1111
latex_elements:
1212
papersize: a4paper
1313
pointsize: 10pt

0 commit comments

Comments
 (0)