Plugin TS Setting are empty in Scheduler nor Console Command
Problem: Defining some TS Variables and add these to to plugin.settings:
plugin.tx_luxletter_fe {
settings {
header = Company Newsletter
subheader = Company Slogon
unsubscribePid = 123
logos {
logoNormal = {$page.logo.file}
logoInverted = {$page.logo.fileInverted}
}
}
}
In Backend Preview as well as in Frontend Preview (calling Newsletter Page with /?type= 1560777975) everything works fine. However if the Newsletter will be send via Scheduler (CLI) the debugging the variable "settings" will be empty. Checked with simple <f:debugger>{settings}</f:debugger> in Layout Fluid Template.
Solution 1: Using Simple Viewhelper in Template Layout <v:variable.set name="systemEmailSettings" value="{v:variable.typoscript(path: 'lib.systemEmailSettings')}" />
Solution 2: Maybe changes in Configuration Utility can help.
/**
* Get TypoScript settings
*
* @return array
* @throws InvalidConfigurationTypeException
* @throws Exception
*/
public static function getExtensionSettings(): array
{
$ts = ObjectUtility::getConfigurationManager()->getConfiguration(
ConfigurationManagerInterface::**CONFIGURATION_TYPE_FULL_TYPOSCRIPT**,
'luxletter'
return GeneralUtility::removeDotsFromTS(
$ts['plugin.']['tx_luxletter_fe.']
);
);
}
Can you please describe the problem a bit deeper. E.g. you want to set this TypoScript and in template file Y you want to get the values, etc...
For sure! Sorry something went wrong in my initial post. I edited it and added missing informations.
Ok, I played a bit with your solution in getExtensionSettings(), but I failed some times.
Let's say we have this configuration:
plugin {
tx_luxletter_fe {
settings {
# {settings.staticvalue}
staticvalue = Static value from TypoScript
}
variables {
# {dynamicvalue}
dynamicvalue = TEXT
dynamicvalue.value = Dynamic value from TypoScript
}
}
}
variables in
-
NewsletterContainer.htmland in - a content element (e.g. bodytext from CType textmedia) must be parsed correctly
In this different contexts:
- In newsletter preview (with type=1560777975)
- In the test email
- In the newsletter email
I'm open for every PR that fulfills this request.