-
-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #195 from kartolo/release/6.0.0
[TASK] Release version 6.0.0
- Loading branch information
Showing
122 changed files
with
4,290 additions
and
3,714 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# These are supported funding model platforms | ||
|
||
#github: kartolo | ||
patreon: kartolo | ||
custom: ['https://www.paypal.me/kartolo', 'http://www.amazon.de/gp/registry/3NIXEA6OTWU84'] |
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,91 @@ | ||
<?php | ||
namespace DirectMailTeam\DirectMail\Command; | ||
|
||
/* | ||
* This file is part of the TYPO3 CMS project. | ||
* | ||
* It is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License, either version 2 | ||
* of the License, or any later version. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
* | ||
* The TYPO3 project - inspiring people to share! | ||
*/ | ||
|
||
use DirectMailTeam\DirectMail\Dmailer; | ||
use Symfony\Component\Console\Command\Command; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
use TYPO3\CMS\Core\Core\Environment; | ||
use TYPO3\CMS\Core\Utility\GeneralUtility; | ||
|
||
/** | ||
* Class InvokeMailerEngineCommand | ||
* | ||
* Starts sending the newsletter by invoking mailer engine via CLI | ||
* | ||
* Use TYPO3 CLI module dispatcher with `direct_mail:invokemailerengine` | ||
* | ||
* This class replaces the earlier version of EXT:direct_mail/cli/cli_direct_mail.php from Ivan Kartolo, (c) 2008 | ||
* Executes the earlier solely option named 'masssend' which has been dropped as optional argument | ||
* | ||
* @package TYPO3 | ||
* @subpackage tx_directmail | ||
* @author 2019 J.Kummer | ||
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 2 | ||
*/ | ||
class InvokeMailerEngineCommand extends Command | ||
{ | ||
|
||
/** | ||
* Configure the command by defining the name, options and arguments | ||
*/ | ||
public function configure() | ||
{ | ||
$this->setDescription('Invoke Mailer Engine of EXT:directmail'); | ||
$this->setHelp('Describe ...'); | ||
$this->setHelp(' | ||
Sends newsletters which are ready to send. | ||
Depend on how many direct_mail newsletters are planned or left to get send out, | ||
and the extension configuration for number of messages to be sent per cycle of the dmailer cron task, | ||
this command will send the latest open newsletter queue, | ||
like the recommended scheduler task or BE module for invoking maler engine will do.'); | ||
} | ||
|
||
/** | ||
* Executes the command for showing sys_log entries | ||
* | ||
* @param InputInterface $input | ||
* @param OutputInterface $output | ||
*/ | ||
protected function execute(InputInterface $input, OutputInterface $output) | ||
{ | ||
// Check if cronjob is already running: | ||
if (@file_exists(Environment::getPublicPath() . '/typo3temp/tx_directmail_cron.lock')) { | ||
// If the lock is not older than 1 day, skip index creation: | ||
if (filemtime(Environment::getPublicPath() . '/typo3temp/tx_directmail_cron.lock') > (time() - (60 * 60 * 24))) { | ||
die('TYPO3 Direct Mail Cron: Aborting, another process is already running!' . LF); | ||
} else { | ||
echo('TYPO3 Direct Mail Cron: A .lock file was found but it is older than 1 day! Processing mails ...' . LF); | ||
} | ||
} | ||
|
||
$lockfile = Environment::getPublicPath() . '/typo3temp/tx_directmail_cron.lock'; | ||
touch($lockfile); | ||
// Fixing filepermissions | ||
GeneralUtility::fixPermissions($lockfile); | ||
|
||
/** | ||
* The direct_mail engine | ||
* @var $htmlmail Dmailer | ||
*/ | ||
$htmlmail = GeneralUtility::makeInstance(Dmailer::class); | ||
$htmlmail->start(); | ||
$htmlmail->runcron(); | ||
|
||
unlink($lockfile); | ||
} | ||
} |
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
Oops, something went wrong.