luxletter icon indicating copy to clipboard operation
luxletter copied to clipboard

Plugin TS Setting are empty in Scheduler nor Console Command

Open pfuju opened this issue 4 years ago • 3 comments

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.']
                );
        );
    }

pfuju avatar Aug 23 '21 13:08 pfuju

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

einpraegsam avatar Aug 23 '21 13:08 einpraegsam

For sure! Sorry something went wrong in my initial post. I edited it and added missing informations.

pfuju avatar Aug 23 '21 15:08 pfuju

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.html and 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.

einpraegsam avatar Aug 23 '21 18:08 einpraegsam