Website settings with sites

When using different sites in Pimcore, the website settings doesn’t load correctly.

$websiteConfig = \Pimcore\Config::getWebsiteConfig();
$emailDocument = $websiteConfig->get(‘emailDoc’);

It get the website settings from the main website, but not the website settings from the site configured in the website settings.
I have 3 emailDoc configured in the website settings.
One for the main website and two others for different site configured (siteId 1 & 2).

Do I need to configure something else to get the website setting for the current siteId?

I’ve found a solution to write my own ConfigService that load the correct config files for subsite.

It should work by default in Pimcore, but I remember there being a bug if you add the main site once (the one without a concrete site selected), it chooses that over the ones with a site selected. If you remove the main one again, and add it to the bottom of the list, it works.

Hi, thanks for you input. I will try this too.