Gets a list of email templates suitable for populating the email template dropdown.

@return array
490750
public function getEmailTemplateDropdownValues()
    {
        $templates = [];

        $finder = new FileFinder();
        $finder->setOption('name_regex', '/^.*\.ss$/');

        $parent = $this->getFormParent();

        if (!$parent) {
            return [];
        }

        $emailTemplateDirectory = $parent->config()->get('email_template_directory');
        $templateDirectory = ModuleResourceLoader::resourcePath($emailTemplateDirectory);

        if (!$templateDirectory) {
            return [];
        }

        $found = $finder->find(BASE_PATH . DIRECTORY_SEPARATOR . $templateDirectory);

        foreach ($found as $key => $value) {
            $template = pathinfo($value);
            $absoluteFilename = $template['dirname'] . DIRECTORY_SEPARATOR . $template['filename'];

            // Optionally remove vendor/ path prefixes
            $resource = ModuleResourceLoader::singleton()->resolveResource($emailTemplateDirectory);
            if ($resource instanceof ModuleResource && $resource->getModule()) {
                $prefixToStrip = $resource->getModule()->getPath();
            } else {
                $prefixToStrip = BASE_PATH;
            }
            $templatePath = substr($absoluteFilename, strlen($prefixToStrip) + 1);

            // Optionally remove "templates/" prefixes
            if (preg_match('/(?<=templates\/).*$/', $templatePath, $matches)) {
                $templatePath = $matches[0];
            }

            $templates[$templatePath] = $template['filename'];
        }

        return $templates;
    }
1274175
public function getTemplateBlocks($templateFileName)
    {
        $templateBlocksWithContent = [];

        $config = \OxidEsales\Eshop\Core\Registry::getConfig();

        $tplDir = trim($config->getConfigParam('_sTemplateDir'), '/\\');
        $templateFileName = str_replace(['\\', '//'], '/', $templateFileName);
        if (preg_match('@/' . preg_quote($tplDir, '@') . '/(.*)$@', $templateFileName, $m)) {
            $templateFileName = $m[1];
        }

        if ($this->isShopTemplateBlockOverriddenByActiveModule()) {
            $shopId = $config->getShopId();

            $ids = $this->_getActiveModuleInfo();

            $activeModulesId = array_keys($ids);
            $activeThemeIds = oxNew(\OxidEsales\Eshop\Core\Theme::class)->getActiveThemesList();

            $templateBlockRepository = oxNew(ModuleTemplateBlockRepository::class);
            $activeBlockTemplates = $templateBlockRepository->getBlocks($templateFileName, $activeModulesId, $shopId, $activeThemeIds);

            if ($activeBlockTemplates) {
                $activeBlockTemplatesByTheme = $this->filterTemplateBlocks($activeBlockTemplates);

                $templateBlocksWithContent = $this->fillTemplateBlockWithContent($activeBlockTemplatesByTheme);
            }
        }

        return $templateBlocksWithContent;
    }
717291
public function getNotificationTemplateData() {
		return array(
			'Content'		=> $this->Content,
			'HTMLContent'	=> $this->ConvertedContent(),
			'Title'			=> $this->Title,
			'Link'			=> $this->Link(),
			'AbsoluteLink'	=> $this->AbsoluteLink(),
			'ThreadLink'	=> $this->ThreadLink(),
			'AbsoluteThreadLink'	=> $this->AbsoluteThreadLink(),
		);
	}
632233
public function getTemplates()
	{
		$templates = [
			'br' => '<br/>',
			'e'  => '',
			'i'  => '',
			'p'  => '<p><xsl:apply-templates/></p>',
			's'  => ''
		];

		foreach ($this->configurator->tags as $tagName => $tag)
		{
			if (isset($tag->template))
			{
				$templates[$tagName] = (string) $tag->template;
			}
		}

		ksort($templates);

		return $templates;
	}
469176
public function getMailHeaders()
    {
        $headers = [];

        $html = $this->getHtml();
        $text = $this->getText();
        $subject = $this->getSubject();

        if ($html != "" || count($this->attachments) > 0) {
            $mime = new MimeDocument("multipart/alternative", crc32($html) . crc32($text) . crc32($subject));
            $headers = $mime->getHeaders();
        } else {
            $headers["Content-Type"] = "text/plain; charset=utf-8";
        }

        $headers["From"] = (string)$this->getSender();
        $headers["Subject"] = $subject;

        return $headers;
    }
1039407
private function _getTemplateList()
    {
        $dirlist = CommonFunctions::gdc(PSI_APP_ROOT.'/templates/');
        sort($dirlist);
        foreach ($dirlist as $file) {
            $tpl_ext = substr($file, strlen($file) - 4);
            $tpl_name = substr($file, 0, strlen($file) - 4);
            if ($tpl_ext === ".css") {
                if (preg_match("/(\S+)_bootstrap$/", $tpl_name, $ar_buf)) {
                    array_push($this->_bootstrap_templates, $ar_buf[1]);
                } else {
                    array_push($this->_templates, $tpl_name);
                }
            }
        }
    }
769052
public function getEmailTemplateView()
    {
        if (! $this->_template_view instanceof LibBaseViewTemplate) {

            if (!isset($this->_template_view)) {
                $this->_template_view = clone $this->_mixer->getIdentifier();
                $this->_template_view->path = array('emails');
                $this->_template_view->name = 'template';
            }

            $identifier = clone $this->_mixer->getIdentifier();
            $identifier->path = array('emails');

            $directory = dirname($identifier->filepath);
            if (strpos($directory, ANPATH_ROOT) === false) {
                $directory = ANPATH_ROOT.$directory;
            }

            $paths[] = $directory;
            $paths[] = implode(DS, array(ANPATH_THEMES, $this->getService('application')->getTemplate(), 'emails', $identifier->type.'_'.$identifier->package));
            $paths[] = implode(DS, array(ANPATH_THEMES, $this->getService('application')->getTemplate(), 'emails'));

            $config = array(
                'base_url' => $this->_base_url,
                'template_paths' => $paths,
            );

            register_default(array(
                'identifier' => $this->_template_view,
                'default' => 'LibBaseViewTemplate'
            ));

            $this->_template_view = $this->getService($this->_template_view, $config);
        }

        return $this->_template_view;
    }
637728
public function getArrguments()
    {
        return [
            'model-name' => $this->modelName,
            '--table-name' => $this->tableName,
            '--connection-name' => $this->connectionName,
            '--engine-name' => $this->engineName,
            '--resource-file' => $this->resourceFile,
            '--template-name' => $this->template,
            '--without-timestamps' => $this->withoutTimestamps,
            '--with-soft-delete' => $this->withSoftDelete,
        ];
    }
1045915
public function getDeliveryDropdownFields()
    {
        $contact = $this->getContact();

        return FieldList::create(
            CompositeField::create(
                DropdownField::create(
                    'ShippingAddress',
                    _t(
                        'SilverCommerce\Checkout.DeliveryAddress',
                        'Delivery Address'
                    ),
                    $contact->Locations()
                ),
                FormAction::create(
                    'doAddNewShipping',
                    _t(
                        'SilverCommerce\Checkout.UseDifferentAddress',
                        'Use Different Address'
                    )
                )->addextraClass('btn btn-link')
                ->setAttribute('formnovalidate',true)
            )->setName("DeliveryFields")
        );
    }
1300579
protected static function pluginsWithTemplates(): array
    {
        $plugins = Plugin::loaded();

        array_walk($plugins, function ($plugin, $index) use (&$plugins) {
            $paths = App::path('Template', $plugin);

            array_walk($paths, function ($path, $index) use (&$paths) {
                if (!is_dir($path)) {
                    unset($paths[$index]);
                }
            });
        });

        return $plugins;
    }
575286
protected function getTemplateContents()
    {
        $parser = new NameParser($this->argument('name'));

        if ($parser->isCreate()) {
            return Stub::create('/migration/create.stub', [
                'class' => $this->getClass(),
                'table' => $parser->getTable(),
                'fields' => $this->getSchemaParser()->render(),
            ]);
        } elseif ($parser->isAdd()) {
            return Stub::create('/migration/add.stub', [
                'class' => $this->getClass(),
                'table' => $parser->getTable(),
                'fields_up' => $this->getSchemaParser()->up(),
                'fields_down' => $this->getSchemaParser()->down(),
            ]);
        } elseif ($parser->isDelete()) {
            return Stub::create('/migration/delete.stub', [
                'class' => $this->getClass(),
                'table' => $parser->getTable(),
                'fields_down' => $this->getSchemaParser()->up(),
                'fields_up' => $this->getSchemaParser()->down(),
            ]);
        } elseif ($parser->isDrop()) {
            return Stub::create('/migration/drop.stub', [
                'class' => $this->getClass(),
                'table' => $parser->getTable(),
                'fields' => $this->getSchemaParser()->render(),
            ]);
        }

        throw new \InvalidArgumentException('Invalid migration name');
    }
528832
public function getTemplateList()
    {
        $templates = [];
        foreach ($this->storage->findTemplates() as $site) {
            $templates[$site->id] = $site->title;
        }

        return $templates;
    }
472229
public static function get_page_templates() {
		static $wrappers = [];
		if ( $wrappers ) {
			return $wrappers;
		}

		$page_templates = new Model\Page_Templates();
		$wrappers = $page_templates->get();
		return $wrappers;
	}
988269
public function getTemplatesForWebPreView()
    {
        $templates = array();
        $templates = $this->addTemplate($templates, 'Reset Passwort Email', AzineTemplateProvider::FOS_USER_PWD_RESETTING_TEMPLATE);
        $templates = $this->addTemplate($templates, 'Account activation', AzineTemplateProvider::FOS_USER_REGISTRATION_TEMPLATE);
        // override this method to add your own templates
        // $templates =$this->addTemplate($templates, "Some other mail",	ExampleTemplateProvider::SOME_OTHER_MAIL_TEMPLATE);
        // $templates =$this->addTemplate($templates, "VIP Infos",	ExampleTemplateProvider::VIP_INFO_MAIL_TEMPLATE);
        return $templates;
    }
1027443
public function toOptionArray()
    {
        /** @var $collection \Magento\Email\Model\ResourceModel\Template\Collection */
        if (!($collection = $this->coreRegistry->registry('config_system_email_template'))) {
            $collection = $this->templatesFactory->create();
            $collection->load();
            $this->coreRegistry->register('config_system_email_template', $collection);
        }
        return $this->emailConfig->getAvailableTemplates();
    }
585515
public function getLists()
    {
        if (sizeof($this->lists) == 0) {
            throw new \RuntimeException("No Mailchimp list has been defined. Check the your config.yml file based on MailchimpBundle's README.md");
        }
        $lists = array();
        foreach ($this->lists as $listId => $listParameters) 
        {            
            $lists[] = $this->createList($listId, $listParameters);            
        }
        return $lists;
    }
870431
public function getOptions()
    {
        return [
            \Dotdigitalgroup\Email\Model\Importer::NOT_IMPORTED => __('Not Imported'),
            \Dotdigitalgroup\Email\Model\Importer::IMPORTING => __('Importing'),
            \Dotdigitalgroup\Email\Model\Importer::IMPORTED => __('Imported'),
            \Dotdigitalgroup\Email\Model\Importer::FAILED => __('Failed'),
        ];
    }