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

Public Member Functions

 __construct (private readonly StagesService $stagesService, private readonly PreviewUriBuilder $previewUriBuilder, private readonly MailerInterface $mailer)
 
 notifyStageChange (array $workspaceRecord, int $stageId, array $affectedElements, string $comment, array $recipients, array $currentUser)
 

Protected Member Functions

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

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 42 of file StageChangeNotification.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Workspaces\Notification\StageChangeNotification::__construct ( private readonly StagesService  $stagesService,
private readonly PreviewUriBuilder  $previewUriBuilder,
private readonly MailerInterface  $mailer 
)

Definition at line 46 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 127 of file StageChangeNotification.php.

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,
array  $currentUser 
)

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

Parameters
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
array$currentUser‪array of the be_users row

Definition at line 62 of file StageChangeNotification.php.

References $GLOBALS, TYPO3\CMS\Workspaces\Notification\StageChangeNotification\findFirstPageId(), and TYPO3\CMS\Workspaces\Notification\StageChangeNotification\sendEmail().

◆ 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.

Definition at line 140 of file StageChangeNotification.php.

References $GLOBALS.

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