Returns a list of all mail templates.
@return array Returns an array of the MailTemplate objects.
321735
public static function allTemplates()
    {
        $result = [];
        $codes = array_keys(self::listAllTemplates());

        foreach ($codes as $code) {
            $result[] = self::findOrMakeTemplate($code);
        }

        return $result;
    }
525575
public function getSortedTemplates()
    {
        $select = new Select('melis_cms_template');
        $select->order('tpl_zf2_website_folder ASC');
        $select->order('tpl_name ASC');

        $resultSet = $this->tableGateway->selectWith($select);


        return $resultSet;
    }
299294
public function syncEmailTemplates()
    {
        if ($this->jobHasAlreadyBeenRun('ddg_automation_email_templates')) {
            $message = 'Skipping ddg_automation_email_templates job run';
            $this->helper->log($message);
            return $message;
        }

        return $this->templateFactory->create()
            ->sync();
    }
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,
        ];
    }
182518
public static function generateEmailTemplate() 
	{
		$setting = SupportMailSetting::model()->findByPk(1, array(
			'select' => 'mail_name',
		));
		$address = OmmuMeta::model()->findByPk(1, array(
			'select' => 'id, office_place, office_village, office_district, office_city_id, office_province_id, office_country_id, office_zipcode, office_phone, office_fax, office_hotline, office_email, office_website',
		));
		$social = SupportContacts::model()->findAll(array(
			//'select' => 'publish, name',
			'condition' => 'publish = :publish',
			'params' => array(
				':publish' => 1,
			),
		));
		$place = $address->office_place;
		$village = $address->office_village ? ', '.$address->office_village : '';
		$district = $address->office_district ? ', '.$address->office_district : '';
		$city = $address->city->city_name ? ', '.$address->city->city_name : '';
		$province = $address->province->province_name ? ', '.$address->province->province_name : '';
		$zipcode = $address->office_zipcode ? ' '.$address->office_zipcode : '';
		$country = $address->country->country_name ? $address->country->country_name : '';
		
		$message = '{content}'."\n\n";
		$message .= '<p>'.Yii::t('phrase', 'If you have any questions please answer to this email or contact us at {office_email} and {office_hotline}', array('{office_email}'=>'<a href="mailto:'.$address->office_email.'">'.$address->office_email.'</a>','{office_hotline}'=>'<a href="callto:'.$address->office_hotline.'">'.$address->office_hotline.'</a>')).'</p>'."\n";
		$message .= Yii::t('phrase', 'Salam,').'<br/>'."\n";
		$message .= $setting->mail_name.'<br/>'."\n";
		if($address) {
			$message .= $place.$village.$district.$city.$province.$zipcode.' '.$country.'<br/>'."\n";
			if($address->office_website)
				$message .= '<a href="http://'.$address->office_website.'" title="">Website</a>';
		}
		if($social) {
			$count = count($social);
			$i = 0;
			foreach($social as $key => $val) {
				$i++;
				if($i == $count)
					$message .= ' | <a href="'.$val->contact_name.'" title="">'.$val->category->title->message.'</a>';
				else
					$message .= ' | <a href="'.$val->contact_name.'" title="">'.$val->category->title->message.'</a>';
			}
		}

		file_put_contents('email_template.php', $message);
	}
1131459
public function getEmailFields()
    {
        $fields = array(
            'email' => EmailField::create($this->getFieldName('email'), _t('SilverStripe\Omnipay\PaymentForm.Email', 'Email'))
        );

        $this->cullForGateway($fields);

        return FieldList::create($fields);
    }
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;
    }
853710
private function getTemplates()
	{
		if (is_null($this->templates))
		{
			useLib('templates');
			$this->templates = new Templates();
		}

		return $this->templates;
	}
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;
	}
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();
    }
560316
public function getTemplatesToGenerate()
    {
        return parent::getTemplatesToGenerate() + array(
            'ListBuilderTemplate'.self::TWIG_EXTENSION
                => 'Resources/views/'.$this->getBaseGeneratorName().'List/index.html.twig',
            'List/FiltersBuilderTemplate'.self::TWIG_EXTENSION
                => 'Resources/views/'.$this->getBaseGeneratorName().'List/filters.html.twig',
            'List/ResultsBuilderTemplate'.self::TWIG_EXTENSION
                => 'Resources/views/'.$this->getBaseGeneratorName().'List/results.html.twig',
            'List/RowBuilderTemplate'.self::TWIG_EXTENSION
                => 'Resources/views/'.$this->getBaseGeneratorName().'List/row.html.twig',
        );
    }
1141596
public function getPrettyMailboxes()
    {
        $mailboxes = $this->getMailboxes();
        $result = [];
        if (is_array($mailboxes) && count($mailboxes) > 0) {
            $prefixedMailbox = "INBOX.";
            foreach ($mailboxes as $mailbox) {
                // Remove the server prefix
                $mailbox = str_replace('{'.$this->settings['server'].'}', '', $mailbox);

                // Remove the INBOX. prefix (if present)
                $mailbox = str_replace($prefixedMailbox, '', $mailbox);

                $result[] = $mailbox;
            }
        }

        return $result;
    }
432913
public function getTemplateResources()
    {
        return new TemplateResources(
            $this->stylesheets,
            $this->headerScripts,
            $this->headerIncludes,
            $this->footerScripts,
            $this->footerIncludes
        );
    }
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);
                }
            }
        }
    }
728461
public function getFormTemplate()
    {
        if (null === $this->formTemplate) {
            $template = rtrim($this->getTemplatePrefix(), '/') . '/' . $this->getFormSuffix();
            $this->setFormTemplate($template);
        }

        return $this->formTemplate;
    }
1028360
public function getMailTemplate()
    {
        $chunks = explode('\\', get_class($this));
        $className = array_pop($chunks);

        return [
            uncamelcase($className),
            'community_translation',
        ];
    }
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;
	}