Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin TS Setting are empty in Scheduler nor Console Command #92

Open
pfuju opened this issue Aug 23, 2021 · 3 comments
Open

Plugin TS Setting are empty in Scheduler nor Console Command #92

pfuju opened this issue Aug 23, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@pfuju
Copy link
Contributor

pfuju commented Aug 23, 2021

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.']
                );
        );
    }
@einpraegsam
Copy link
Collaborator

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

@pfuju
Copy link
Contributor Author

pfuju commented Aug 23, 2021

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

@einpraegsam
Copy link
Collaborator

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 einpraegsam added the enhancement New feature or request label Aug 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants