| Total Complexity | 84 |
| Total Lines | 717 |
| Duplicated Lines | 0 % |
| Changes | 7 | ||
| Bugs | 2 | Features | 0 |
Complex classes like Notifier often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use Notifier, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 26 | class Notifier |
||
| 27 | { |
||
| 28 | /** |
||
| 29 | * clientRepository |
||
| 30 | * |
||
| 31 | * @var \EWW\Dpf\Domain\Repository\ClientRepository |
||
| 32 | * @inject |
||
| 33 | */ |
||
| 34 | protected $clientRepository = null; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * documentTypeRepository |
||
| 38 | * |
||
| 39 | * @var \EWW\Dpf\Domain\Repository\DocumentTypeRepository |
||
| 40 | * @inject |
||
| 41 | */ |
||
| 42 | protected $documentTypeRepository = null; |
||
| 43 | |||
| 44 | /** |
||
| 45 | * depositLicenseRepository |
||
| 46 | * |
||
| 47 | * @var \EWW\Dpf\Domain\Repository\DepositLicenseRepository |
||
| 48 | * @inject |
||
| 49 | */ |
||
| 50 | protected $depositLicenseRepository = null; |
||
| 51 | |||
| 52 | /** |
||
| 53 | * security |
||
| 54 | * |
||
| 55 | * @var \EWW\Dpf\Security\Security |
||
| 56 | * @inject |
||
| 57 | */ |
||
| 58 | protected $security = null; |
||
| 59 | |||
| 60 | public function sendAdminNewSuggestionNotification(\EWW\Dpf\Domain\Model\Document $document) { |
||
| 61 | try { |
||
| 62 | /** @var $client \EWW\Dpf\Domain\Model\Client */ |
||
| 63 | $client = $this->clientRepository->findAll()->current(); |
||
| 64 | $clientAdminEmail = $client->getAdminEmail(); |
||
| 65 | $documentType = $this->documentTypeRepository->findOneByUid($document->getDocumentType()); |
||
|
|
|||
| 66 | |||
| 67 | $args = $this->getMailMarkerArray($document, $client, $documentType); |
||
| 68 | |||
| 69 | // Notify client admin |
||
| 70 | if ($clientAdminEmail) { |
||
| 71 | $subject = $client->getAdminNewSuggestionSubject(); |
||
| 72 | $body = $client->getAdminNewSuggestionBody(); |
||
| 73 | $mailType = 'text/html'; |
||
| 74 | |||
| 75 | if (empty($subject)) { |
||
| 76 | $subject = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:notification.newSuggestion.admin.subject', 'dpf'); |
||
| 77 | } |
||
| 78 | |||
| 79 | if (empty($body)) { |
||
| 80 | $body = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:notification.newSuggestion.admin.body', 'dpf'); |
||
| 81 | $mailType = 'text/plain'; |
||
| 82 | } |
||
| 83 | |||
| 84 | $this->sendMail($clientAdminEmail, $subject, $body, $args, $mailType); |
||
| 85 | |||
| 86 | } |
||
| 87 | |||
| 88 | } catch (\Exception $e) { |
||
| 89 | /** @var $logger \TYPO3\CMS\Core\Log\Logger */ |
||
| 90 | $logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(__CLASS__); |
||
| 91 | |||
| 92 | $logger->log( |
||
| 93 | LogLevel::ERROR, "sendAdminNewSuggestionNotification failed", |
||
| 94 | array( |
||
| 95 | 'document' => $document |
||
| 96 | ) |
||
| 97 | ); |
||
| 98 | } |
||
| 99 | } |
||
| 100 | |||
| 101 | |||
| 102 | public function sendAdminEmbargoExpiredNotification(\EWW\Dpf\Domain\Model\Document $document) { |
||
| 103 | try { |
||
| 104 | /** @var $client \EWW\Dpf\Domain\Model\Client */ |
||
| 105 | $client = $this->clientRepository->findAll()->current(); |
||
| 106 | $clientAdminEmail = $client->getAdminEmail(); |
||
| 107 | $documentType = $this->documentTypeRepository->findOneByUid($document->getDocumentType()); |
||
| 108 | |||
| 109 | $args = $this->getMailMarkerArray($document, $client, $documentType); |
||
| 110 | |||
| 111 | // Notify client admin |
||
| 112 | if ($clientAdminEmail) { |
||
| 113 | $subject = $client->getAdminEmbargoSubject(); |
||
| 114 | $body = $client->getAdminEmbargoBody(); |
||
| 115 | $mailType = 'text/html'; |
||
| 116 | |||
| 117 | if (empty($subject)) { |
||
| 118 | $subject = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:notification.embargoExpired.admin.subject', 'dpf'); |
||
| 119 | } |
||
| 120 | |||
| 121 | if (empty($body)) { |
||
| 122 | $body = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:notification.embargoExpired.admin.body', 'dpf'); |
||
| 123 | $mailType = 'text/plain'; |
||
| 124 | } |
||
| 125 | |||
| 126 | $this->sendMail($clientAdminEmail, $subject, $body, $args, $mailType); |
||
| 127 | |||
| 128 | } |
||
| 129 | |||
| 130 | } catch (\Exception $e) { |
||
| 131 | /** @var $logger \TYPO3\CMS\Core\Log\Logger */ |
||
| 132 | $logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(__CLASS__); |
||
| 133 | |||
| 134 | $logger->log( |
||
| 135 | LogLevel::ERROR, "sendAdminEmbargoExpiredNotification failed", |
||
| 136 | array( |
||
| 137 | 'document' => $document |
||
| 138 | ) |
||
| 139 | ); |
||
| 140 | } |
||
| 141 | } |
||
| 142 | |||
| 143 | public function getMailMarkerArray(Document $document, $client, $documentType, $reason = "") { |
||
| 226 | } |
||
| 227 | |||
| 228 | public function sendSuggestionAcceptNotification(\EWW\Dpf\Domain\Model\Document $document) { |
||
| 229 | |||
| 230 | try { |
||
| 231 | /** @var Client $client */ |
||
| 232 | $client = $this->clientRepository->findAll()->current(); |
||
| 233 | $documentType = $this->documentTypeRepository->findOneByUid($document->getDocumentType()); |
||
| 234 | |||
| 235 | $internalFormat = new \EWW\Dpf\Helper\InternalFormat($document->getXmlData()); |
||
| 236 | |||
| 237 | $args = $this->getMailMarkerArray($document, $client, $documentType); |
||
| 238 | |||
| 239 | // Active messaging: Suggestion accept |
||
| 240 | if ($client->getActiveMessagingSuggestionAcceptUrl()) { |
||
| 241 | if ($internalFormat->getFisId()) { |
||
| 242 | $request = Request::post($client->getActiveMessagingSuggestionAcceptUrl()); |
||
| 243 | if ($body = $client->getActiveMessagingSuggestionAcceptUrlBody()) { |
||
| 244 | $request->body($this->replaceMarkers($body, $args)); |
||
| 245 | } |
||
| 246 | $request->send(); |
||
| 247 | } |
||
| 248 | } |
||
| 249 | |||
| 250 | } catch (\Exception $e) { |
||
| 251 | /** @var $logger \TYPO3\CMS\Core\Log\Logger */ |
||
| 252 | $logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(__CLASS__); |
||
| 253 | |||
| 254 | $logger->log( |
||
| 255 | LogLevel::ERROR, "sendSuggestionAcceptNotification failed", |
||
| 256 | array( |
||
| 257 | 'document' => $document |
||
| 258 | ) |
||
| 259 | ); |
||
| 260 | } |
||
| 261 | } |
||
| 262 | |||
| 263 | /** |
||
| 264 | * @param Document $document |
||
| 265 | * @param string $reason |
||
| 266 | */ |
||
| 267 | public function sendSuggestionDeclineNotification(\EWW\Dpf\Domain\Model\Document $document, $reason = "") { |
||
| 297 | ) |
||
| 298 | ); |
||
| 299 | } |
||
| 300 | } |
||
| 301 | |||
| 302 | public function sendChangedDocumentNotification(\EWW\Dpf\Domain\Model\Document $document, $addedFisIdOnly = false) { |
||
| 333 | ) |
||
| 334 | ); |
||
| 335 | } |
||
| 336 | } |
||
| 337 | |||
| 338 | |||
| 339 | public function sendReleasePublishNotification(\EWW\Dpf\Domain\Model\Document $document) |
||
| 340 | { |
||
| 341 | try { |
||
| 342 | /** @var Client $client */ |
||
| 343 | $client = $this->clientRepository->findAll()->current(); |
||
| 344 | |||
| 345 | $internalFormat = new \EWW\Dpf\Helper\InternalFormat($document->getXmlData()); |
||
| 346 | |||
| 347 | $documentType = $this->documentTypeRepository->findOneByUid($document->getDocumentType()); |
||
| 348 | |||
| 349 | $args = $this->getMailMarkerArray($document, $client, $documentType); |
||
| 350 | |||
| 351 | // Active messaging: New document (Release publish) |
||
| 352 | if ($client->getActiveMessagingNewDocumentUrl()) { |
||
| 353 | $fisId = $internalFormat->getFisId(); |
||
| 354 | if (empty($fisId)) { |
||
| 355 | $request = Request::post($client->getActiveMessagingNewDocumentUrl()); |
||
| 356 | if ($body = $client->getActiveMessagingNewDocumentUrlBody()) { |
||
| 357 | $request->body($this->replaceMarkers($body, $args)); |
||
| 358 | } |
||
| 359 | $request->send(); |
||
| 360 | } |
||
| 361 | } |
||
| 362 | |||
| 363 | } catch (\Exception $e) { |
||
| 364 | /** @var $logger \TYPO3\CMS\Core\Log\Logger */ |
||
| 365 | $logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(__CLASS__); |
||
| 366 | |||
| 367 | $logger->log( |
||
| 368 | LogLevel::ERROR, "sendReleasePublishNotification failed", |
||
| 369 | array( |
||
| 370 | 'document' => $document |
||
| 371 | ) |
||
| 372 | ); |
||
| 373 | } |
||
| 374 | } |
||
| 375 | |||
| 376 | |||
| 377 | public function sendNewDocumentNotification(\EWW\Dpf\Domain\Model\Document $document) |
||
| 378 | { |
||
| 379 | |||
| 380 | try { |
||
| 381 | /** @var Client $client */ |
||
| 382 | $client = $this->clientRepository->findAll()->current(); |
||
| 383 | $clientAdminEmail = $client->getAdminEmail(); |
||
| 384 | $internalFormat = new \EWW\Dpf\Helper\InternalFormat($document->getXmlData()); |
||
| 385 | $submitterEmail = $internalFormat->getSubmitterEmail(); |
||
| 386 | $documentType = $this->documentTypeRepository->findOneByUid($document->getDocumentType()); |
||
| 387 | $authors = $document->getAuthors(); |
||
| 388 | |||
| 389 | $args = $this->getMailMarkerArray($document, $client, $documentType); |
||
| 390 | |||
| 391 | // Notify client admin |
||
| 392 | if ($clientAdminEmail) { |
||
| 393 | $subject = $client->getAdminNewDocumentNotificationSubject(); |
||
| 394 | $body = $client->getAdminNewDocumentNotificationBody(); |
||
| 395 | $mailType = 'text/html'; |
||
| 396 | |||
| 397 | if (empty($subject)) { |
||
| 398 | $subject = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:notification.newDocument.admin.subject', 'dpf'); |
||
| 399 | } |
||
| 400 | |||
| 401 | if (empty($body)) { |
||
| 402 | $body = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:notification.newDocument.admin.body', 'dpf'); |
||
| 403 | $mailType = 'text/plain'; |
||
| 404 | } |
||
| 405 | |||
| 406 | $this->sendMail($clientAdminEmail, $subject, $body, $args, $mailType); |
||
| 407 | |||
| 408 | } |
||
| 409 | |||
| 410 | |||
| 411 | // Notify submitter |
||
| 412 | if ($submitterEmail) { |
||
| 413 | $subject = $client->getSubmitterNewDocumentNotificationSubject(); |
||
| 414 | $body = $client->getSubmitterNewDocumentNotificationBody(); |
||
| 415 | $mailType = 'text/html'; |
||
| 416 | |||
| 417 | if (empty($subject)) { |
||
| 418 | $subject = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:notification.newDocument.submitter.subject', 'dpf'); |
||
| 419 | } |
||
| 420 | |||
| 421 | if (empty($body)) { |
||
| 422 | $body = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:notification.newDocument.submitter.body', 'dpf'); |
||
| 423 | $mailType = 'text/plain'; |
||
| 424 | } |
||
| 425 | |||
| 426 | $this->sendMail($submitterEmail, $subject, $body, $args, $mailType); |
||
| 427 | } |
||
| 428 | |||
| 429 | } catch (\Exception $e) { |
||
| 430 | /** @var $logger \TYPO3\CMS\Core\Log\Logger */ |
||
| 431 | $logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(__CLASS__); |
||
| 432 | |||
| 433 | $logger->log( |
||
| 434 | LogLevel::ERROR, "sendNewDocumentNotification failed", |
||
| 435 | array( |
||
| 436 | 'document' => $document |
||
| 437 | ) |
||
| 438 | ); |
||
| 439 | } |
||
| 440 | |||
| 441 | } |
||
| 442 | |||
| 443 | public function sendIngestNotification(\EWW\Dpf\Domain\Model\Document $document) |
||
| 444 | { |
||
| 445 | |||
| 446 | try { |
||
| 447 | $client = $this->clientRepository->findAll()->current(); |
||
| 448 | $internalFormat = new \EWW\Dpf\Helper\InternalFormat($document->getXmlData()); |
||
| 449 | $submitterEmail = $internalFormat->getSubmitterEmail(); |
||
| 450 | $documentType = $this->documentTypeRepository->findOneByUid($document->getDocumentType()); |
||
| 451 | |||
| 452 | $args = $this->getMailMarkerArray($document, $client, $documentType); |
||
| 453 | |||
| 454 | // Notify submitter |
||
| 455 | if ($submitterEmail) { |
||
| 456 | $subject = $client->getSubmitterIngestNotificationSubject(); |
||
| 457 | $body = $client->getSubmitterIngestNotificationBody(); |
||
| 458 | $mailType = 'text/html'; |
||
| 459 | |||
| 460 | if (empty($subject)) { |
||
| 461 | $subject = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:notification.ingestDocument.submitter.subject', 'dpf'); |
||
| 462 | } |
||
| 463 | |||
| 464 | if (empty($body)) { |
||
| 465 | $body = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:notification.ingestDocument.submitter.body', 'dpf'); |
||
| 466 | $mailType = 'text/plain'; |
||
| 467 | } |
||
| 468 | |||
| 469 | $this->sendMail($submitterEmail, $subject, $body, $args, $mailType); |
||
| 470 | } |
||
| 471 | } catch (\Exception $e) { |
||
| 472 | /** @var $logger \TYPO3\CMS\Core\Log\Logger */ |
||
| 473 | $logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(__CLASS__); |
||
| 474 | |||
| 475 | $logger->log( |
||
| 476 | LogLevel::ERROR, "sendIngestNotification failed", |
||
| 477 | array( |
||
| 478 | 'document' => $document |
||
| 479 | ) |
||
| 480 | ); |
||
| 481 | } |
||
| 482 | |||
| 483 | } |
||
| 484 | |||
| 485 | public function sendEmbargoNotification(\EWW\Dpf\Domain\Model\Document $document) { |
||
| 521 | ) |
||
| 522 | ); |
||
| 523 | } |
||
| 524 | } |
||
| 525 | |||
| 526 | public function sendRegisterNotification(\EWW\Dpf\Domain\Model\Document $document) |
||
| 527 | { |
||
| 528 | |||
| 529 | try { |
||
| 530 | $client = $this->clientRepository->findAll()->current(); |
||
| 531 | $clientAdminEmail = $client->getAdminEmail(); |
||
| 532 | $documentType = $this->documentTypeRepository->findOneByUid($document->getDocumentType()); |
||
| 533 | |||
| 534 | $args = $this->getMailMarkerArray($document, $client, $documentType); |
||
| 535 | |||
| 536 | // Notify client admin |
||
| 537 | if ($clientAdminEmail) { |
||
| 538 | $subject = $client->getAdminRegisterDocumentNotificationSubject(); |
||
| 539 | $body = $client->getAdminRegisterDocumentNotificationBody(); |
||
| 540 | $mailType = 'text/html'; |
||
| 541 | |||
| 542 | if (empty($subject)) { |
||
| 543 | $subject = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:notification.registerDocument.admin.subject', 'dpf'); |
||
| 544 | } |
||
| 545 | |||
| 546 | if (empty($body)) { |
||
| 547 | $body = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:notification.registerDocument.admin.body', 'dpf'); |
||
| 548 | $mailType = 'text/plain'; |
||
| 549 | } |
||
| 550 | |||
| 551 | $this->sendMail($clientAdminEmail, $subject, $body, $args, $mailType); |
||
| 552 | |||
| 553 | } |
||
| 554 | |||
| 555 | } catch (\Exception $e) { |
||
| 556 | /** @var $logger \TYPO3\CMS\Core\Log\Logger */ |
||
| 557 | $logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(__CLASS__); |
||
| 558 | |||
| 559 | $logger->log( |
||
| 560 | LogLevel::ERROR, "sendRegisterNotification failed", |
||
| 561 | array( |
||
| 562 | 'document' => $document |
||
| 563 | ) |
||
| 564 | ); |
||
| 565 | } |
||
| 566 | |||
| 567 | } |
||
| 568 | |||
| 569 | /** |
||
| 570 | * @param \EWW\Dpf\Domain\Model\Document $document |
||
| 571 | * @param array $recipients |
||
| 572 | */ |
||
| 573 | public function sendMyPublicationUpdateNotification(\EWW\Dpf\Domain\Model\Document $document, $recipients) |
||
| 617 | ) |
||
| 618 | ); |
||
| 619 | } |
||
| 620 | |||
| 621 | } |
||
| 622 | |||
| 623 | |||
| 624 | /** |
||
| 625 | * @param \EWW\Dpf\Domain\Model\Document $document |
||
| 626 | * @param array $recipients |
||
| 627 | */ |
||
| 628 | public function sendMyPublicationNewNotification(\EWW\Dpf\Domain\Model\Document $document, $recipients) |
||
| 629 | { |
||
| 630 | |||
| 631 | try { |
||
| 632 | /** @var Client $client */ |
||
| 633 | $client = $this->clientRepository->findAll()->current(); |
||
| 634 | $documentType = $this->documentTypeRepository->findOneByUid($document->getDocumentType()); |
||
| 635 | $author = array_shift($document->getAuthors()); |
||
| 636 | |||
| 637 | $args = $this->getMailMarkerArray($document, $client, $documentType); |
||
| 638 | |||
| 639 | // Notify client admin |
||
| 640 | /** @var FrontendUser $recipient */ |
||
| 641 | foreach ($recipients as $recipient) { |
||
| 642 | |||
| 643 | if ($recipient->getEmail()) { |
||
| 644 | |||
| 645 | $subject = $client->getMypublicationsNewNotificationSubject(); |
||
| 646 | $body = $client->getMypublicationsNewNotificationBody(); |
||
| 647 | $mailType = 'text/html'; |
||
| 648 | |||
| 649 | if (empty($subject)) { |
||
| 650 | $subject = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:notification.newPublication.mypublications.subject', |
||
| 651 | 'dpf'); |
||
| 652 | } |
||
| 653 | |||
| 654 | if (empty($body)) { |
||
| 655 | $body = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:notification.newPublication.mypublications.body', |
||
| 656 | 'dpf'); |
||
| 657 | $mailType = 'text/plain'; |
||
| 658 | } |
||
| 659 | |||
| 660 | $this->sendMail($recipient->getEmail(), $subject, $body, $args, $mailType); |
||
| 661 | } |
||
| 662 | } |
||
| 663 | |||
| 664 | } catch (\Exception $e) { |
||
| 665 | /** @var $logger \TYPO3\CMS\Core\Log\Logger */ |
||
| 666 | $logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(__CLASS__); |
||
| 667 | |||
| 668 | $logger->log( |
||
| 669 | LogLevel::ERROR, "sendRegisterNotification failed", |
||
| 670 | array( |
||
| 671 | 'document' => $document |
||
| 672 | ) |
||
| 673 | ); |
||
| 674 | } |
||
| 675 | |||
| 676 | } |
||
| 677 | |||
| 678 | public function sendDepositLicenseNotification(\EWW\Dpf\Domain\Model\Document $document) |
||
| 679 | { |
||
| 680 | |||
| 681 | try { |
||
| 682 | /** @var Client $client */ |
||
| 683 | $client = $this->clientRepository->findAll()->current(); |
||
| 684 | $clientAdminEmail = $client->getAdminEmail(); |
||
| 685 | $documentType = $this->documentTypeRepository->findOneByUid($document->getDocumentType()); |
||
| 686 | |||
| 687 | $args = $this->getMailMarkerArray($document, $client, $documentType); |
||
| 688 | |||
| 689 | // Notify client admin |
||
| 690 | if ($clientAdminEmail && $client->isSendAdminDepositLicenseNotification()) { |
||
| 691 | |||
| 692 | $subject = $client->getAdminDepositLicenseNotificationSubject(); |
||
| 693 | $body = $client->getAdminDepositLicenseNotificationBody(); |
||
| 694 | $mailType = 'text/html'; |
||
| 695 | |||
| 696 | if (empty($subject)) { |
||
| 697 | $subject = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:notification.depositLicense.admin.subject', 'dpf'); |
||
| 698 | } |
||
| 699 | |||
| 700 | if (empty($body)) { |
||
| 701 | $body = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:notification.depositLicense.admin.body', 'dpf'); |
||
| 702 | $mailType = 'text/plain'; |
||
| 703 | } |
||
| 704 | |||
| 705 | $this->sendMail($clientAdminEmail, $subject, $body, $args, $mailType); |
||
| 706 | } |
||
| 707 | |||
| 708 | } catch (\Exception $e) { |
||
| 709 | /** @var $logger \TYPO3\CMS\Core\Log\Logger */ |
||
| 710 | $logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(__CLASS__); |
||
| 711 | |||
| 712 | $logger->log( |
||
| 713 | LogLevel::ERROR, "sendDepositLicenseNotification failed", |
||
| 714 | array( |
||
| 715 | 'document' => $document |
||
| 716 | ) |
||
| 717 | ); |
||
| 718 | } |
||
| 719 | |||
| 720 | } |
||
| 721 | |||
| 722 | protected function replaceMarkers($message, $args) |
||
| 730 | } |
||
| 731 | |||
| 732 | |||
| 733 | protected function sendMail($reveiver, $subject, $body, $args, $mailType) |
||
| 734 | { |
||
| 735 | $emailReceiver = array(); |
||
| 736 | $emailReceiver[$reveiver] = $reveiver; |
||
| 746 |