‪TYPO3CMS  10.4
TYPO3\CMS\Workspaces\Notification\StageChangeNotification Class Reference
Inheritance diagram for TYPO3\CMS\Workspaces\Notification\StageChangeNotification:

Public Member Functions

 __construct ()
 
 notifyStageChange (array $workspaceRecord, int $stageId, array $affectedElements, string $comment, array $recipients, BackendUserAuthentication $currentUser)
 

Protected Member Functions

int findFirstPageId (string $elementTable, int $elementUid, array $elementRecord)
 
 sendEmail (array $recipientData, array $emailConfig, array $variablesForView)
 

Protected Attributes

StagesService $stagesService
 
PreviewUriBuilder $previewUriBuilder
 
Mailer $mailer
 

Detailed Description

Responsible for sending out emails when one or multiple records have been changed / sent to the next stage.

Relevant options are "tx_workspaces.emails.*" via userTS / pageTS.

This is a concrete implementation of sending out emails, and not part of the public TYPO3 Core API

Definition at line 43 of file StageChangeNotification.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Workspaces\Notification\StageChangeNotification::__construct ( )

Definition at line 59 of file StageChangeNotification.php.

Member Function Documentation

◆ findFirstPageId()

int TYPO3\CMS\Workspaces\Notification\StageChangeNotification::findFirstPageId ( string  $elementTable,
int  $elementUid,
array  $elementRecord 
)
protected

As it is possible that multiple elements are sent out, or multiple pages, the first "real" page ID is found.

Parameters
string$elementTable‪the table of the first element found
int$elementUid‪the uid of the first element in the list
array$elementRecord‪the full record
Returns
‪int the corresponding page ID

Definition at line 141 of file StageChangeNotification.php.

References TYPO3\CMS\Backend\Utility\BackendUtility\fixVersioningPid().

Referenced by TYPO3\CMS\Workspaces\Notification\StageChangeNotification\notifyStageChange().

◆ notifyStageChange()

TYPO3\CMS\Workspaces\Notification\StageChangeNotification::notifyStageChange ( array  $workspaceRecord,
int  $stageId,
array  $affectedElements,
string  $comment,
array  $recipients,
BackendUserAuthentication  $currentUser 
)

Send an email notification to users in workspace in multiple languages, depending on each BE users' language preference.

Parameters
array$workspaceRecord
int$stageId‪Next Stage Number
array$affectedElements‪List of element names (table / uid pairs)
string$comment‪User comment sent along with action
array$recipients‪List of recipients to notify, list is generated by workspace extension module
BackendUserAuthentication$currentUser

Definition at line 77 of file StageChangeNotification.php.

References $GLOBALS, TYPO3\CMS\Workspaces\Notification\StageChangeNotification\findFirstPageId(), TYPO3\CMS\Backend\Utility\BackendUtility\getPagesTSconfig(), TYPO3\CMS\Backend\Utility\BackendUtility\getRecord(), TYPO3\CMS\Backend\Utility\BackendUtility\getRecordPath(), TYPO3\CMS\Backend\Utility\BackendUtility\getRecordTitle(), and TYPO3\CMS\Workspaces\Notification\StageChangeNotification\sendEmail().

Referenced by TYPO3\CMS\Workspaces\Hook\DataHandlerHook\sendStageChangeNotification().

◆ sendEmail()

TYPO3\CMS\Workspaces\Notification\StageChangeNotification::sendEmail ( array  $recipientData,
array  $emailConfig,
array  $variablesForView 
)
protected

Send one email to a specific person, apply multi-language possibilities for sending this email out.

Parameters
array$recipientData
array$emailConfig
array$variablesForView

Definition at line 157 of file StageChangeNotification.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Workspaces\Notification\StageChangeNotification\notifyStageChange().

Member Data Documentation

◆ $mailer

Mailer TYPO3\CMS\Workspaces\Notification\StageChangeNotification::$mailer
protected

Definition at line 57 of file StageChangeNotification.php.

◆ $previewUriBuilder

PreviewUriBuilder TYPO3\CMS\Workspaces\Notification\StageChangeNotification::$previewUriBuilder
protected

Definition at line 53 of file StageChangeNotification.php.

◆ $stagesService

StagesService TYPO3\CMS\Workspaces\Notification\StageChangeNotification::$stagesService
protected

Definition at line 49 of file StageChangeNotification.php.