问题
Is it possible to notice if the content changed in the Backend and then, for example, to send a mail?
In other words, can I somehow notice who modified the contents in the backend and then automatically send an email?
回答1:
Yes. When content is changed in the backend, several hooks are called before and after the database operations. You can register for each of those hooks. The class you want to have a look at for the right hook is \TYPO3\CMS\Core\DataHandling\DataHandler
.
You can e.g. register a class for the processDatamap_afterDatabaseOperations
hook by adding the class name to the array
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass']
in your ext_localconf.php
.
You can find more about hooks in TYPO3 here: https://usetypo3.com/signals-and-hooks-in-typo3.html
来源:https://stackoverflow.com/questions/38131327/execute-code-upon-content-changes-in-typo3