Feature #23752
closedStage notification emails should be localizable
0%
Description
Right now, when you want to notify admins/editors etc of a stage change of an element, the stage notification emails are HARDCODED (!) in a php file. It is a nasty string that you can override with pageTSconfig TCEMAIN.notificationEmail_body or TCEMAIN.notificationEmail_subject, but still the variables are replaced through a nasty sprintf() function which is a NOGO (!) (especially since we have nice markers ;-)).
The attached patch moves the hardcoded email subject + body of emails that are sent when an elements' stage is changed (editing / reviewing etc) into a LLL file, and thus allows to make the stage change and have localized labels, plus speaking variables through available markers.
It keeps backwards compatibility for the existing values, but throws a warning in the deprecation log, but only IF the existing tsConfig option was set before.
Additionally, the function that retrieves the email addresses from the BE users needed to be adopted to send the username, email address, and the users' used language with it to localize the email.
Another nice option is that you can now specify the headers that the email should send along. With that you can finally set proper sender email or reply-to headers.
The new pageTSconfig / userTSconfig options are:
tx_version.workspaces.stageNotificationEmail.subject = LLL:EXT:version/Resources/Private/Language/emails.xml:subject
tx_version.workspaces.stageNotificationEmail.message = LLL:EXT:version/Resources/Private/Language/emails.xml:message
tx_version.workspaces.stageNotificationEmail.additionalHeaders =
(issue imported from #M16019)
Files