Model/Email/Template.php
public function sync()
    {
        $result = ['store' => 'Stores : ', 'message' => 'Done.'];
        $lastWebsiteId = '0';
        foreach ($this->storeManager->getStores(true) as $store) {
            $storeId = $store->getId();
            //store not enabled to sync
            if (! $this->helper->isStoreEnabled($storeId)) {
                continue;
            }
            //reset the campaign ids for each website
            $websiteId = $store->getWebsiteId();
            if ($websiteId != $lastWebsiteId) {
                $this->processedCampaigns = [];
                $lastWebsiteId = $websiteId;
            }

            foreach ($this->templateConfigIdToDotmailerConfigPath as $configTemplateId => $dotConfigPath) {
                $campaignId = $this->getConfigValue($dotConfigPath, $storeId);
                $configPath = $this->templateConfigMapping[$configTemplateId];
                $emailTemplateId = $this->getConfigValue($configPath, $storeId);

                if ($campaignId && $emailTemplateId && ! in_array($campaignId, $this->processedCampaigns)) {
                    //sync template for store
                    $this->syncEmailTemplate($campaignId, $emailTemplateId, $store);
                    $result['store'] .= ', ' . $store->getCode();

                    $this->processedCampaigns[$campaignId] = $campaignId;
                }
            }
        }

        return $result;
    }
public function sync()
    {
        $result = ['store' => 'Stores : ', 'message' => 'Done.'];
        $lastWebsiteId = '0';
        foreach ($this->storeManager->getStores(true) as $store) {
            $storeId = $store->getId();
            //store not enabled to sync
            if (! $this->helper->isStoreEnabled($storeId)) {
                continue;
            }
            //reset the campaign ids for each website
            $websiteId = $store->getWebsiteId();
            if ($websiteId != $lastWebsiteId) {
                $this->processedCampaigns = [];
                $lastWebsiteId = $websiteId;
            }

            foreach ($this->templateConfigIdToDotmailerConfigPath as $configTemplateId => $dotConfigPath) {
                $campaignId = $this->getConfigValue($dotConfigPath, $storeId);
                $configPath = $this->templateConfigMapping[$configTemplateId];
                $emailTemplateId = $this->getConfigValue($configPath, $storeId);

                if ($campaignId && $emailTemplateId && ! in_array($campaignId, $this->processedCampaigns)) {
                    //sync template for store
                    $this->syncEmailTemplate($campaignId, $emailTemplateId, $store);
                    $result['store'] .= ', ' . $store->getCode();

                    $this->processedCampaigns[$campaignId] = $campaignId;
                }
            }
        }

        return $result;
    }
public function sync ( ) { $ result = [ 'store' => 'Stores : ' , 'message' => 'Done.' ] ; $ lastWebsiteId = '0' ; foreach ( $ this -> storeManager -> getStores ( true ) as $ store ) { $ storeId = $ store -> getId ( ) ; //store not enabled to sync if ( ! $ this -> helper -> isStoreEnabled ( $ storeId ) ) { continue ; } //reset the campaign ids for each website $ websiteId = $ store -> getWebsiteId ( ) ; if ( $ websiteId != $ lastWebsiteId ) { $ this -> processedCampaigns = [ ] ; $ lastWebsiteId = $ websiteId ; } foreach ( $ this -> templateConfigIdToDotmailerConfigPath as $ configTemplateId => $ dotConfigPath ) { $ campaignId = $ this -> getConfigValue ( $ dotConfigPath , $ storeId ) ; $ configPath = $ this -> templateConfigMapping [ $ configTemplateId ] ; $ emailTemplateId = $ this -> getConfigValue ( $ configPath , $ storeId ) ; if ( $ campaignId && $ emailTemplateId && ! in_array ( $ campaignId , $ this -> processedCampaigns ) ) { //sync template for store $ this -> syncEmailTemplate ( $ campaignId , $ emailTemplateId , $ store ) ; $ result [ 'store' ] .= ', ' . $ store -> getCode ( ) ; $ this -> processedCampaigns [ $ campaignId ] = $ campaignId ; } } } return $ result ; }
Template sync.

@return array
Template sync .