Skip to content

Commit

Permalink
Merge branch 'send'
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaip committed Jan 26, 2017
2 parents 31a5bfa + 332dc1f commit 7f14ee5
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
3 changes: 1 addition & 2 deletions Classes/Psmb/Newsletter/Controller/NewsletterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use TYPO3\Flow\I18n\Translator;
use TYPO3\Flow\Mvc\Controller\ActionController;
use TYPO3\Flow\Annotations as Flow;
use function TYPO3\Flow\var_dump;
use TYPO3\TYPO3CR\Domain\Model\NodeInterface;

class NewsletterController extends ActionController
Expand Down Expand Up @@ -105,7 +104,7 @@ public function testSendAction($subscription, NodeInterface $node, $email)
$subscriber->setEmail($email);
$subscriber->setName('Test User');

$letter = $this->fusionMailService->generateSubscriptionLetter($subscriber, $subscriptions[0], $node);
$letter = $this->fusionMailService->generateSubscriptionLetter($subscriber, reset($subscriptions), $node);
$this->fusionMailService->sendLetter($letter);

$this->view->assign('value', ['status' => 'success']);
Expand Down
3 changes: 3 additions & 0 deletions Classes/Psmb/Newsletter/Service/FusionMailService.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use TYPO3\TYPO3CR\Domain\Model\Node;
use TYPO3\TYPO3CR\Domain\Model\NodeInterface;
use TYPO3\TYPO3CR\Domain\Service\ContextFactoryInterface;
use Flowpack\JobQueue\Common\Annotations as Job;

/**
* @Flow\Scope("singleton")
Expand Down Expand Up @@ -51,6 +52,8 @@ public function setupObject(ControllerContext $controllerContext, ActionRequest
}

/**
* @Job\Defer(queueName="psmb-newsletter")
*
* @param array $letter
* @throws \Exception
*/
Expand Down
3 changes: 0 additions & 3 deletions Configuration/Policy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ roles:
-
privilegeTarget: 'Psmb.Newsletter:Subscription'
permission: GRANT
-
privilegeTarget: 'Psmb.Newsletter:Backend'
permission: GRANT
'TYPO3.Neos:Editor':
privileges:
-
Expand Down
9 changes: 9 additions & 0 deletions Configuration/Settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ TYPO3:
requireJsPathMapping:
'Psmb.Newsletter/Views': 'resource://Psmb.Newsletter/Public/JavaScript/Inspector/Views'

Flowpack:
JobQueue:
Common:
queues:
'psmb-newsletter':
className: 'Flowpack\JobQueue\Common\Queue\FakeQueue'
options:
async: true

#Psmb:
# Newsletter:
# globalSettings:
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"typo3/neos": "^2.3",
"psmb/registry": "*",
"typo3/swiftmailer": "*",
"tijsverkoyen/css-to-inline-styles": "^2.2"
"tijsverkoyen/css-to-inline-styles": "^2.2",
"flowpack/jobqueue-common": "^1.0"
},
"autoload": {
"psr-0": {
Expand Down

0 comments on commit 7f14ee5

Please sign in to comment.